diff options
author | Jens Axboe <axboe@suse.de> | 2006-07-19 14:29:12 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:29:41 -0400 |
commit | bf57225670bcbeb357182d800736b4782cde7295 (patch) | |
tree | c86d71fefff36090fc5c2ea3694f95d0162cdc2c /block/cfq-iosched.c | |
parent | dc72ef4ae35c2016fb594bcc85ce871376682174 (diff) |
[PATCH] cfq-iosched: improve queue preemption
Don't touch the current queues, just make sure that the wanted queue
is selected next. Simplifies the logic.
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 9f684cc66bd1..141104835952 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -1539,17 +1539,19 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq, | |||
1539 | */ | 1539 | */ |
1540 | static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) | 1540 | static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) |
1541 | { | 1541 | { |
1542 | struct cfq_queue *__cfqq, *next; | 1542 | cfq_slice_expired(cfqd, 1); |
1543 | |||
1544 | list_for_each_entry_safe(__cfqq, next, &cfqd->cur_rr, cfq_list) | ||
1545 | cfq_resort_rr_list(__cfqq, 1); | ||
1546 | 1543 | ||
1547 | if (!cfqq->slice_left) | 1544 | if (!cfqq->slice_left) |
1548 | cfqq->slice_left = cfq_prio_to_slice(cfqd, cfqq) / 2; | 1545 | cfqq->slice_left = cfq_prio_to_slice(cfqd, cfqq) / 2; |
1549 | 1546 | ||
1547 | /* | ||
1548 | * Put the new queue at the front of the of the current list, | ||
1549 | * so we know that it will be selected next. | ||
1550 | */ | ||
1551 | BUG_ON(!cfq_cfqq_on_rr(cfqq)); | ||
1552 | list_move(&cfqq->cfq_list, &cfqd->cur_rr); | ||
1553 | |||
1550 | cfqq->slice_end = cfqq->slice_left + jiffies; | 1554 | cfqq->slice_end = cfqq->slice_left + jiffies; |
1551 | cfq_slice_expired(cfqd, 1); | ||
1552 | __cfq_set_active_queue(cfqd, cfqq); | ||
1553 | } | 1555 | } |
1554 | 1556 | ||
1555 | /* | 1557 | /* |