diff options
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 163263ddd381..ee55019066a1 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -3117,18 +3117,17 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq, | |||
3117 | */ | 3117 | */ |
3118 | static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) | 3118 | static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) |
3119 | { | 3119 | { |
3120 | struct cfq_queue *old_cfqq = cfqd->active_queue; | ||
3121 | |||
3122 | cfq_log_cfqq(cfqd, cfqq, "preempt"); | 3120 | cfq_log_cfqq(cfqd, cfqq, "preempt"); |
3123 | cfq_slice_expired(cfqd, 1); | ||
3124 | 3121 | ||
3125 | /* | 3122 | /* |
3126 | * workload type is changed, don't save slice, otherwise preempt | 3123 | * workload type is changed, don't save slice, otherwise preempt |
3127 | * doesn't happen | 3124 | * doesn't happen |
3128 | */ | 3125 | */ |
3129 | if (cfqq_type(old_cfqq) != cfqq_type(cfqq)) | 3126 | if (cfqq_type(cfqd->active_queue) != cfqq_type(cfqq)) |
3130 | cfqq->cfqg->saved_workload_slice = 0; | 3127 | cfqq->cfqg->saved_workload_slice = 0; |
3131 | 3128 | ||
3129 | cfq_slice_expired(cfqd, 1); | ||
3130 | |||
3132 | /* | 3131 | /* |
3133 | * Put the new queue at the front of the of the current list, | 3132 | * Put the new queue at the front of the of the current list, |
3134 | * so we know that it will be selected next. | 3133 | * so we know that it will be selected next. |