aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2012-01-19 03:20:09 -0500
committerJens Axboe <axboe@kernel.dk>2012-01-19 03:20:09 -0500
commitdf0793abb929e66606fa25f3875ff1b89de5ad32 (patch)
treefa53e6e4e7f4a6773f45173132bbfd77908f7c17 /block
parent90a4c0f51e8e44111a926be6f4c87af3938a79c3 (diff)
block,cfq: change code order
cfq_slice_expired will change saved_workload_slice. It should be called first so saved_workload_slice is correctly set to 0 after workload type is changed. This fixes the code order changed by 54b466e44b1c7. Tested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index ee55019066a1..da21c24dbed3 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -3117,17 +3117,18 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
3117 */ 3117 */
3118static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) 3118static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
3119{ 3119{
3120 enum wl_type_t old_type = cfqq_type(cfqd->active_queue);
3121
3120 cfq_log_cfqq(cfqd, cfqq, "preempt"); 3122 cfq_log_cfqq(cfqd, cfqq, "preempt");
3123 cfq_slice_expired(cfqd, 1);
3121 3124
3122 /* 3125 /*
3123 * workload type is changed, don't save slice, otherwise preempt 3126 * workload type is changed, don't save slice, otherwise preempt
3124 * doesn't happen 3127 * doesn't happen
3125 */ 3128 */
3126 if (cfqq_type(cfqd->active_queue) != cfqq_type(cfqq)) 3129 if (old_type != cfqq_type(cfqq))
3127 cfqq->cfqg->saved_workload_slice = 0; 3130 cfqq->cfqg->saved_workload_slice = 0;
3128 3131
3129 cfq_slice_expired(cfqd, 1);
3130
3131 /* 3132 /*
3132 * Put the new queue at the front of the of the current list, 3133 * Put the new queue at the front of the of the current list,
3133 * so we know that it will be selected next. 3134 * so we know that it will be selected next.