From: Gui Jianfeng Date: Tue, 8 Dec 2009 07:54:17 +0000 (+0100) Subject: cfq: Optimization for close cooperating queue searching X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b9d8f4c73b1af4cfd53f819bf84c2bce31232275;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Signed-off-by: Jens Axboe --- 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 @@ -1749,6 +1749,12 @@ static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd, if (CFQQ_SEEKY(cur_cfqq)) 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,