Skip to contentSkip to conversation

cfq: Optimization for close cooperating queue searching

PATCH In review Gui Jianfeng 3 participants 3 messages Dec 8, 2009 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfq: Optimization for close cooperating queue searching

It doesn't make any sense to try to find out a close cooperating queue if current cfqq is the only one in the group.

---
 block/cfq-iosched.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
block/cfq-iosched.c +6 -0
index cfb0b2f..89b5dd9 100644
@@ -1750,6 +1750,12 @@ static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd,
 		return NULL;
 
 	/*
+	 * Don't search priority tree if it's the only queue in the group.
+	 */
+	if (cur_cfqq->cfqg->nr_cfqq == 1)
+		return NULL;
+
+	/*
 	 * We should notice if some of the queues are cooperating, eg
 	 * working closely on the same area of the disk. In that case,
 	 * we can group them together and don't waste time idling.
Signature · 1 line
1.5.4.rc3
#1 lore raw
Quoted 27 lines · Gui Jianfeng

It doesn't make any sense to try to find out a close cooperating queue if current cfqq is the only one in the group.

---
 block/cfq-iosched.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
block/cfq-iosched.c +6 -0
index cfb0b2f..89b5dd9 100644
@@ -1750,6 +1750,12 @@ static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd,
 		return NULL;
 
 	/*
+	 * Don't search priority tree if it's the only queue in the group.
+	 */
+	if (cur_cfqq->cfqg->nr_cfqq == 1)
+		return NULL;
+
+	/*
 	 * We should notice if some of the queues are cooperating, eg
 	 * working closely on the same area of the disk. In that case,
 	 * we can group them together and don't waste time idling.
Signature · 1 line
1.5.4.rc3

Good point, thanks applied.

Signature · 1 line
Jens Axboe
#2 lore raw
In reply to Gui Jianfeng
Quoted 4 lines · Gui Jianfeng

It doesn't make any sense to try to find out a close cooperating queue if current cfqq is the only one in the group.

Thanks Gui. Looks good.

Vivek

Quoted 23 lines
---
 block/cfq-iosched.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
block/cfq-iosched.c +6 -0
index cfb0b2f..89b5dd9 100644
@@ -1750,6 +1750,12 @@ static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd,
 		return NULL;
 
 	/*
+	 * Don't search priority tree if it's the only queue in the group.
+	 */
+	if (cur_cfqq->cfqg->nr_cfqq == 1)
+		return NULL;
+
+	/*
 	 * We should notice if some of the queues are cooperating, eg
 	 * working closely on the same area of the disk. In that case,
 	 * we can group them together and don't waste time idling.
Signature · 1 line
1.5.4.rc3