Skip to content

Commit

Permalink
cfq: set workload as expired if it doesn't have any slice left
Browse files Browse the repository at this point in the history
When a group is resumed, if it doesn't have workload slice left,
we should set workload_expires as expired. Otherwise, we might
start from where we left in previous group by error.
Thanks the idea from Corrado.

Signed-off-by: Gui Jianfeng <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
guijianfeng authored and Jens Axboe committed Dec 15, 2009
1 parent 82bbbf2 commit 66ae291
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,9 @@ static void cfq_choose_cfqg(struct cfq_data *cfqd)
cfqd->workload_expires = jiffies + cfqg->saved_workload_slice;
cfqd->serving_type = cfqg->saved_workload;
cfqd->serving_prio = cfqg->saved_serving_prio;
}
} else
cfqd->workload_expires = jiffies - 1;

choose_service_tree(cfqd, cfqg);
}

Expand Down

0 comments on commit 66ae291

Please sign in to comment.