summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorGui Jianfeng <guijianfeng@cn.fujitsu.com>2009-12-08 08:54:17 +0100
committerJens Axboe <jens.axboe@oracle.com>2009-12-09 15:11:03 +0100
commitb9d8f4c73b1af4cfd53f819bf84c2bce31232275 (patch)
tree2ae92bc6cabfd9d2308902c3ac92f04fe6fbf1fb /block
parenta3b8d92d25212c5b6534ae9b347ed2858de78336 (diff)
downloadlinux-b9d8f4c73b1af4cfd53f819bf84c2bce31232275.tar.gz
linux-b9d8f4c73b1af4cfd53f819bf84c2bce31232275.tar.bz2
linux-b9d8f4c73b1af4cfd53f819bf84c2bce31232275.zip
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. Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 5009af490a0c..b19cd684bf12 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -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.