Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eda5e0c9 authored by Justin TerAvest's avatar Justin TerAvest Committed by Jens Axboe
Browse files

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: default avatarJustin TerAvest <teravest@google.com>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 1e9bb880
Loading
Loading
Loading
Loading
+23 −16
Original line number Diff line number Diff line
@@ -1620,12 +1620,9 @@ 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_set_active_queue(struct cfq_data *cfqd,
static void cfq_clear_queue_stats(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;
@@ -1643,6 +1640,15 @@ static void __cfq_set_active_queue(struct cfq_data *cfqd,
	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;
}

@@ -3332,7 +3338,8 @@ static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
	BUG_ON(!cfq_cfqq_on_rr(cfqq));

	cfq_service_tree_add(cfqd, cfqq, 1);
	__cfq_set_active_queue(cfqd, cfqq);

	cfq_clear_queue_stats(cfqd, cfqq);
}

/*