diff options
author | Gui Jianfeng <guijianfeng@cn.fujitsu.com> | 2009-11-26 09:14:11 +0100 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-11-26 09:14:11 +0100 |
commit | 3586e917f2c7df769d173c4ec99554cb40a911e5 (patch) | |
tree | d72ad5ca6c17a3db628734e36b22d79065e0eb49 | |
parent | cciss: change Cmd_sg_list.sg_chain_dma type to dma_addr_t (diff) | |
download | linux-3586e917f2c7df769d173c4ec99554cb40a911e5.tar.xz linux-3586e917f2c7df769d173c4ec99554cb40a911e5.zip |
cfq: Make use of service count to estimate the rb_key offset
For the moment, different workload cfq queues are put into different
service trees. But CFQ still uses "busy_queues" to estimate rb_key
offset when inserting a cfq queue into a service tree. I think this
isn't appropriate, and it should make use of service tree count to do
this estimation. This patch is for for-2.6.33 branch.
Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | block/cfq-iosched.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 1bcbd8c79896..467981e19d7a 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -600,11 +600,15 @@ cfq_find_next_rq(struct cfq_data *cfqd, struct cfq_queue *cfqq, static unsigned long cfq_slice_offset(struct cfq_data *cfqd, struct cfq_queue *cfqq) { + struct cfq_rb_root *service_tree; + + service_tree = service_tree_for(cfqq_prio(cfqq), cfqq_type(cfqq), cfqd); + /* * just an approximation, should be ok. */ - return (cfqd->busy_queues - 1) * (cfq_prio_slice(cfqd, 1, 0) - - cfq_prio_slice(cfqd, cfq_cfqq_sync(cfqq), cfqq->ioprio)); + return service_tree->count * (cfq_prio_slice(cfqd, 1, 0) - + cfq_prio_slice(cfqd, cfq_cfqq_sync(cfqq), cfqq->ioprio)); } /* |