cfq: Optimization for close cooperating queue searching
authorGui Jianfeng <guijianfeng@cn.fujitsu.com>
Tue, 8 Dec 2009 07:54:17 +0000 (08:54 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 9 Dec 2009 14:11:03 +0000 (15:11 +0100)
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>
block/cfq-iosched.c

index 5009af4..b19cd68 100644 (file)
@@ -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.