diff options
author | Shaohua Li <shaohua.li@intel.com> | 2012-01-19 09:20:09 +0100 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-01-08 10:42:52 +0100 |
commit | ca5f41360f85eb7c7a371bdb5948f3f2c2ebd74f (patch) | |
tree | c23f4fa4787b1f08f8946faabdf28921afd25172 /block | |
parent | 29b697ed8490435c596405d48aea97a407a9a6c8 (diff) | |
download | kernel_samsung_tuna-ca5f41360f85eb7c7a371bdb5948f3f2c2ebd74f.zip kernel_samsung_tuna-ca5f41360f85eb7c7a371bdb5948f3f2c2ebd74f.tar.gz kernel_samsung_tuna-ca5f41360f85eb7c7a371bdb5948f3f2c2ebd74f.tar.bz2 |
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.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 5a5b185..f4f6533 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -3162,17 +3162,18 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq, */ static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) { + enum wl_type_t old_type = cfqq_type(cfqd->active_queue); + cfq_log_cfqq(cfqd, cfqq, "preempt"); + cfq_slice_expired(cfqd, 1); /* * workload type is changed, don't save slice, otherwise preempt * doesn't happen */ - if (cfqq_type(cfqd->active_queue) != cfqq_type(cfqq)) + if (old_type != cfqq_type(cfqq)) cfqq->cfqg->saved_workload_slice = 0; - cfq_slice_expired(cfqd, 1); - /* * Put the new queue at the front of the of the current list, * so we know that it will be selected next. |