mirror of https://gitee.com/openkylin/linux.git
cfq-iosched: Don't clear queue stats when preempt.
For v2, I added back lines to cfq_preempt_queue() that were removed during updates for accounting unaccounted_time. Thanks for pointing out that I'd missed these, Vivek. Previous commit "cfq-iosched: Don't set active queue in preempt" wrongly cleared stats for preempting queues when it shouldn't have, because when we choose a queue to preempt, it still isn't necessarily scheduled next. Thanks to Vivek Goyal for figuring this out and understanding how the preemption code works. Signed-off-by: Justin TerAvest <teravest@google.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
This commit is contained in:
parent
04521db04e
commit
62a37f6bad
|
@ -1620,9 +1620,12 @@ static inline void cfq_del_timer(struct cfq_data *cfqd, struct cfq_queue *cfqq)
|
|||
cfq_blkiocg_update_idle_time_stats(&cfqq->cfqg->blkg);
|
||||
}
|
||||
|
||||
static void cfq_clear_queue_stats(struct cfq_data *cfqd,
|
||||
static void __cfq_set_active_queue(struct cfq_data *cfqd,
|
||||
struct cfq_queue *cfqq)
|
||||
{
|
||||
if (cfqq) {
|
||||
cfq_log_cfqq(cfqd, cfqq, "set_active wl_prio:%d wl_type:%d",
|
||||
cfqd->serving_prio, cfqd->serving_type);
|
||||
cfq_blkiocg_update_avg_queue_size_stats(&cfqq->cfqg->blkg);
|
||||
cfqq->slice_start = 0;
|
||||
cfqq->dispatch_start = jiffies;
|
||||
|
@ -1638,15 +1641,6 @@ static void cfq_clear_queue_stats(struct cfq_data *cfqd,
|
|||
cfq_mark_cfqq_slice_new(cfqq);
|
||||
|
||||
cfq_del_timer(cfqd, cfqq);
|
||||
}
|
||||
|
||||
static void __cfq_set_active_queue(struct cfq_data *cfqd,
|
||||
struct cfq_queue *cfqq)
|
||||
{
|
||||
if (cfqq) {
|
||||
cfq_log_cfqq(cfqd, cfqq, "set_active wl_prio:%d wl_type:%d",
|
||||
cfqd->serving_prio, cfqd->serving_type);
|
||||
cfq_clear_queue_stats(cfqd, cfqq);
|
||||
}
|
||||
|
||||
cfqd->active_queue = cfqq;
|
||||
|
@ -3339,7 +3333,8 @@ static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
|
|||
|
||||
cfq_service_tree_add(cfqd, cfqq, 1);
|
||||
|
||||
cfq_clear_queue_stats(cfqd, cfqq);
|
||||
cfqq->slice_end = 0;
|
||||
cfq_mark_cfqq_slice_new(cfqq);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue