Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Gui Jianfeng and committed by
Jens Axboe
3586e917 32a87c01

+6 -2
+6 -2
block/cfq-iosched.c
··· 600 600 static unsigned long cfq_slice_offset(struct cfq_data *cfqd, 601 601 struct cfq_queue *cfqq) 602 602 { 603 + struct cfq_rb_root *service_tree; 604 + 605 + service_tree = service_tree_for(cfqq_prio(cfqq), cfqq_type(cfqq), cfqd); 606 + 603 607 /* 604 608 * just an approximation, should be ok. 605 609 */ 606 - return (cfqd->busy_queues - 1) * (cfq_prio_slice(cfqd, 1, 0) - 607 - cfq_prio_slice(cfqd, cfq_cfqq_sync(cfqq), cfqq->ioprio)); 610 + return service_tree->count * (cfq_prio_slice(cfqd, 1, 0) - 611 + cfq_prio_slice(cfqd, cfq_cfqq_sync(cfqq), cfqq->ioprio)); 608 612 } 609 613 610 614 /*