aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/cfq-iosched.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 8427697c5437..7bfea53c1bb5 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -3284,10 +3284,19 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
3284 */ 3284 */
3285static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) 3285static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
3286{ 3286{
3287 struct cfq_queue *old_cfqq = cfqd->active_queue;
3288
3287 cfq_log_cfqq(cfqd, cfqq, "preempt"); 3289 cfq_log_cfqq(cfqd, cfqq, "preempt");
3288 cfq_slice_expired(cfqd, 1); 3290 cfq_slice_expired(cfqd, 1);
3289 3291
3290 /* 3292 /*
3293 * workload type is changed, don't save slice, otherwise preempt
3294 * doesn't happen
3295 */
3296 if (cfqq_type(old_cfqq) != cfqq_type(cfqq))
3297 cfqq->cfqg->saved_workload_slice = 0;
3298
3299 /*
3291 * Put the new queue at the front of the of the current list, 3300 * Put the new queue at the front of the of the current list,
3292 * so we know that it will be selected next. 3301 * so we know that it will be selected next.
3293 */ 3302 */