[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20101220194347.GE31012@redhat.com>
Date: Mon, 20 Dec 2010 14:43:47 -0500
From: Vivek Goyal <vgoyal@...hat.com>
To: Gui Jianfeng <guijianfeng@...fujitsu.com>
Cc: Jens Axboe <axboe@...nel.dk>, Corrado Zoccolo <czoccolo@...il.com>,
Chad Talbott <ctalbott@...gle.com>,
Nauman Rafique <nauman@...gle.com>,
Divyesh Shah <dpshah@...gle.com>,
linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 7/8] cfq-iosched: Add flat mode and switch between two
modes by "use_hierarchy"
On Mon, Dec 13, 2010 at 09:45:14AM +0800, Gui Jianfeng wrote:
[..]
>
> + /* Service tree for cfq group flat scheduling mode. */
> + struct cfq_rb_root flat_service_tree;
> +
> /*
> * The priority currently being served
> */
> @@ -647,12 +650,16 @@ cfq_group_slice(struct cfq_data *cfqd, struct cfq_group *cfqg)
> struct cfq_entity *cfqe = &cfqg->cfqe;
> struct cfq_rb_root *st = cfqe->service_tree;
>
> - if (st)
> - return cfq_target_latency * cfqe->weight
> - / st->total_weight;
> - else
> - /* If this is the root group, give it a full slice. */
> - return cfq_target_latency;
> + if (cfqd->use_hierarchy) {
> + if (st)
> + return cfq_target_latency * cfqe->weight
> + / st->total_weight;
> + else
> + /* If this is the root group, give it a full slice. */
> + return cfq_target_latency;
> + } else {
> + return cfq_target_latency * cfqe->weight / st->total_weight;
> + }
> }
Once you have moved the notion of entity and weight of the entity, I think
you can simplify things a bit and come up with a notion of entity slice
in a hieararhy and we can avoid using separate mechanisms for queues and
groups.
There can be multiple ways of doing this and you shall have to see what
is a simple way which works. For queues was keeping a track of average
number of queues and that way estimating the slice length. You can
try keeping track of average number of entities in a group or something
like that. But do think everything now in terms of entities and simplify
the logic a bit.
Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists