diff options
-rw-r--r-- | block/cfq-iosched.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index c72e5acc573d..5ff4f4850e71 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -2560,15 +2560,10 @@ static void cfq_free_io_context(struct io_context *ioc) | |||
2560 | __call_for_each_cic(ioc, cic_free_func); | 2560 | __call_for_each_cic(ioc, cic_free_func); |
2561 | } | 2561 | } |
2562 | 2562 | ||
2563 | static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq) | 2563 | static void cfq_put_cooperator(struct cfq_queue *cfqq) |
2564 | { | 2564 | { |
2565 | struct cfq_queue *__cfqq, *next; | 2565 | struct cfq_queue *__cfqq, *next; |
2566 | 2566 | ||
2567 | if (unlikely(cfqq == cfqd->active_queue)) { | ||
2568 | __cfq_slice_expired(cfqd, cfqq, 0); | ||
2569 | cfq_schedule_dispatch(cfqd); | ||
2570 | } | ||
2571 | |||
2572 | /* | 2567 | /* |
2573 | * If this queue was scheduled to merge with another queue, be | 2568 | * If this queue was scheduled to merge with another queue, be |
2574 | * sure to drop the reference taken on that queue (and others in | 2569 | * sure to drop the reference taken on that queue (and others in |
@@ -2584,6 +2579,16 @@ static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq) | |||
2584 | cfq_put_queue(__cfqq); | 2579 | cfq_put_queue(__cfqq); |
2585 | __cfqq = next; | 2580 | __cfqq = next; |
2586 | } | 2581 | } |
2582 | } | ||
2583 | |||
2584 | static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq) | ||
2585 | { | ||
2586 | if (unlikely(cfqq == cfqd->active_queue)) { | ||
2587 | __cfq_slice_expired(cfqd, cfqq, 0); | ||
2588 | cfq_schedule_dispatch(cfqd); | ||
2589 | } | ||
2590 | |||
2591 | cfq_put_cooperator(cfqq); | ||
2587 | 2592 | ||
2588 | cfq_put_queue(cfqq); | 2593 | cfq_put_queue(cfqq); |
2589 | } | 2594 | } |
@@ -3536,6 +3541,9 @@ split_cfqq(struct cfq_io_context *cic, struct cfq_queue *cfqq) | |||
3536 | } | 3541 | } |
3537 | 3542 | ||
3538 | cic_set_cfqq(cic, NULL, 1); | 3543 | cic_set_cfqq(cic, NULL, 1); |
3544 | |||
3545 | cfq_put_cooperator(cfqq); | ||
3546 | |||
3539 | cfq_put_queue(cfqq); | 3547 | cfq_put_queue(cfqq); |
3540 | return NULL; | 3548 | return NULL; |
3541 | } | 3549 | } |