aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorJustin TerAvest <teravest@google.com>2011-03-22 16:26:49 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-03-22 16:26:49 -0400
commiteda5e0c91fed2d2a38a341b0957263406d330274 (patch)
treed09564b4ef18dc8f9703a3d67def655b24b992c8 /block/cfq-iosched.c
parent1e9bb8808ac11094d711d20d580e7b45a4992d0c (diff)
cfq-iosched: Don't set active queue in preempt
Commit "Add unaccounted time to timeslice_used" changed the behavior of cfq_preempt_queue to set cfqq active. Vivek pointed out that other preemption rules might get involved, so we shouldn't manually set which queue is active. This cleans up the code to just clear the queue stats at preemption time. Signed-off-by: Justin TerAvest <teravest@google.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 12e380b2c4e4..69208d732903 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1620,27 +1620,33 @@ static inline void cfq_del_timer(struct cfq_data *cfqd, struct cfq_queue *cfqq)
1620 cfq_blkiocg_update_idle_time_stats(&cfqq->cfqg->blkg); 1620 cfq_blkiocg_update_idle_time_stats(&cfqq->cfqg->blkg);
1621} 1621}
1622 1622
1623static void cfq_clear_queue_stats(struct cfq_data *cfqd,
1624 struct cfq_queue *cfqq)
1625{
1626 cfq_blkiocg_update_avg_queue_size_stats(&cfqq->cfqg->blkg);
1627 cfqq->slice_start = 0;
1628 cfqq->dispatch_start = jiffies;
1629 cfqq->allocated_slice = 0;
1630 cfqq->slice_end = 0;
1631 cfqq->slice_dispatch = 0;
1632 cfqq->nr_sectors = 0;
1633
1634 cfq_clear_cfqq_wait_request(cfqq);
1635 cfq_clear_cfqq_must_dispatch(cfqq);
1636 cfq_clear_cfqq_must_alloc_slice(cfqq);
1637 cfq_clear_cfqq_fifo_expire(cfqq);
1638 cfq_mark_cfqq_slice_new(cfqq);
1639
1640 cfq_del_timer(cfqd, cfqq);
1641}
1642
1623static void __cfq_set_active_queue(struct cfq_data *cfqd, 1643static void __cfq_set_active_queue(struct cfq_data *cfqd,
1624 struct cfq_queue *cfqq) 1644 struct cfq_queue *cfqq)
1625{ 1645{
1626 if (cfqq) { 1646 if (cfqq) {
1627 cfq_log_cfqq(cfqd, cfqq, "set_active wl_prio:%d wl_type:%d", 1647 cfq_log_cfqq(cfqd, cfqq, "set_active wl_prio:%d wl_type:%d",
1628 cfqd->serving_prio, cfqd->serving_type); 1648 cfqd->serving_prio, cfqd->serving_type);
1629 cfq_blkiocg_update_avg_queue_size_stats(&cfqq->cfqg->blkg); 1649 cfq_clear_queue_stats(cfqd, cfqq);
1630 cfqq->slice_start = 0;
1631 cfqq->dispatch_start = jiffies;
1632 cfqq->allocated_slice = 0;
1633 cfqq->slice_end = 0;
1634 cfqq->slice_dispatch = 0;
1635 cfqq->nr_sectors = 0;
1636
1637 cfq_clear_cfqq_wait_request(cfqq);
1638 cfq_clear_cfqq_must_dispatch(cfqq);
1639 cfq_clear_cfqq_must_alloc_slice(cfqq);
1640 cfq_clear_cfqq_fifo_expire(cfqq);
1641 cfq_mark_cfqq_slice_new(cfqq);
1642
1643 cfq_del_timer(cfqd, cfqq);
1644 } 1650 }
1645 1651
1646 cfqd->active_queue = cfqq; 1652 cfqd->active_queue = cfqq;
@@ -3332,7 +3338,8 @@ static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
3332 BUG_ON(!cfq_cfqq_on_rr(cfqq)); 3338 BUG_ON(!cfq_cfqq_on_rr(cfqq));
3333 3339
3334 cfq_service_tree_add(cfqd, cfqq, 1); 3340 cfq_service_tree_add(cfqd, cfqq, 1);
3335 __cfq_set_active_queue(cfqd, cfqq); 3341
3342 cfq_clear_queue_stats(cfqd, cfqq);
3336} 3343}
3337 3344
3338/* 3345/*