[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1349732700-2694-7-git-send-email-vgoyal@redhat.com>
Date: Mon, 8 Oct 2012 17:44:58 -0400
From: Vivek Goyal <vgoyal@...hat.com>
To: linux-kernel@...r.kernel.org, axboe@...nel.dk
Cc: vgoyal@...hat.com, jmoyer@...hat.com, tj@...nel.org
Subject: [PATCH 6/8] cfq-iosched: put cooperating queue at the front of service tree
Currently during select_queue(), if a cfqq runs out of requests, cfq
checks if there is a cooperating queue doing IO nearby. If yes, it
lets that queue run out of turn.
But while doing so, CFQ does not put that queue at the front of service
tree and select it. It just forces it to be active queue.
This will not play very nice with new algorithm where we keep track
of min_vdisktime on service tree and always select first queue on
the service tree to run.
So instead of force setting active queue, put desired cooperating
queue at the front of service tree (like preemption), and then
go through get_next_cfqq() to select first queue on service tree.
So end result still remains the same, just that this method will
play better with new algorithm.
Signed-off-by: Vivek Goyal <vgoyal@...hat.com>
---
block/cfq-iosched.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 6930eed..9ab6b4b 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2117,12 +2117,11 @@ static struct cfq_queue *cfq_get_next_queue_forced(struct cfq_data *cfqd)
/*
* Get and set a new active queue for service.
*/
-static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd,
- struct cfq_queue *cfqq)
+static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd)
{
- if (!cfqq)
- cfqq = cfq_get_next_queue(cfqd);
+ struct cfq_queue *cfqq;
+ cfqq = cfq_get_next_queue(cfqd);
__cfq_set_active_queue(cfqd, cfqq);
return cfqq;
}
@@ -2653,6 +2652,12 @@ static struct cfq_queue *cfq_select_queue(struct cfq_data *cfqd)
*/
new_cfqq = cfq_close_cooperator(cfqd, cfqq);
if (new_cfqq) {
+ /*
+ * This close cooperator queue will be selected next. Put
+ * it at the front of servie tree and then go through normal
+ * get_next_queue() logic.
+ */
+ cfq_service_tree_add(cfqd, new_cfqq, 1);
if (!cfqq->new_cfqq)
cfq_setup_merge(cfqq, new_cfqq);
goto expire;
@@ -2706,7 +2711,7 @@ new_queue:
if (!new_cfqq)
cfq_choose_cfqg(cfqd);
- cfqq = cfq_set_active_queue(cfqd, new_cfqq);
+ cfqq = cfq_set_active_queue(cfqd);
keep_queue:
return cfqq;
}
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists