Commit b9d8f4c7 authored by Gui Jianfeng's avatar Gui Jianfeng Committed by Jens Axboe

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: default avatarGui Jianfeng <guijianfeng@cn.fujitsu.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent a3b8d92d
...@@ -1749,6 +1749,12 @@ static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd, ...@@ -1749,6 +1749,12 @@ static struct cfq_queue *cfq_close_cooperator(struct cfq_data *cfqd,
if (CFQQ_SEEKY(cur_cfqq)) if (CFQQ_SEEKY(cur_cfqq))
return NULL; 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 * We should notice if some of the queues are cooperating, eg
* working closely on the same area of the disk. In that case, * working closely on the same area of the disk. In that case,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment