Skip to content

Commit

Permalink
cfq: Optimization for close cooperating queue searching
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gui Jianfeng authored and Jens Axboe committed Dec 9, 2009
1 parent a3b8d92 commit b9d8f4c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b9d8f4c

Please sign in to comment.