From: "Michal Koutný" <mkoutny@suse.com>
To: Jan Kara <jack@suse.cz>
Cc: Paolo Valente <paolo.valente@linaro.org>,
linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH 4/8] bfq: Limit number of requests consumed by each cgroup
Date: Tue, 2 Nov 2021 19:16:58 +0100 [thread overview]
Message-ID: <20211102181658.GA63407@blackbody.suse.cz> (raw)
In-Reply-To: <20211006173157.6906-4-jack@suse.cz>
Hello.
On Wed, Oct 06, 2021 at 07:31:43PM +0200, Jan Kara <jack@suse.cz> wrote:
> + for (level--; level >= 0; level--) {
> + entity = entities[level];
> + if (level > 0) {
> + wsum = bfq_entity_service_tree(entity)->wsum;
> + } else {
> + int i;
> + /*
> + * For bfqq itself we take into account service trees
> + * of all higher priority classes and multiply their
> + * weights so that low prio queue from higher class
> + * gets more requests than high prio queue from lower
> + * class.
> + */
> + wsum = 0;
> + for (i = 0; i <= class_idx; i++) {
> + wsum = wsum * IOPRIO_BE_NR +
> + sched_data->service_tree[i].wsum;
> + }
> + }
> + limit = DIV_ROUND_CLOSEST(limit * entity->weight, wsum);
This scheme caught my eye. You mutliply (tree) weights by a factor
depending on the class when counting the wsum but then you don't apply
the same scaling for the evaluated entity in the numerator.
IOW, I think there should be something like
scale = (level > 0) ? 1 : int_pow(IOPRIO_BE_NR, BFQ_IOPRIO_CLASSES - bfq_class_idx(entity));
limit = DIV_ROUND_CLOSEST(limit * entity->weight * scale, wsum);
For instance, if there are two cgroups (level=1) with weights 100 and
200, and each cgroup has a single IOPRIO_CLASS_BE entity (level=0) in
it, the `limit` distribution would honor the ratio of weights from
level=1 (100:200) but it would artificially lower the absolute amount of
allowed tags. If I am not mistaken, that would be reduced by factor
1/BFQ_IOPRIO_CLASSES.
Also if I consider it more broadly, is this supposed to match/extend
bfq_io_prio_to_weight() calculation?
Michal
next prev parent reply other threads:[~2021-11-02 18:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-06 17:31 [PATCH 0/8 v3] bfq: Limit number of allocated scheduler tags per cgroup Jan Kara
2021-10-06 17:31 ` [PATCH 1/8] block: Provide icq in request allocation data Jan Kara
2021-10-06 17:31 ` [PATCH 2/8] bfq: Track number of allocated requests in bfq_entity Jan Kara
2021-10-06 17:31 ` [PATCH 3/8] bfq: Store full bitmap depth in bfq_data Jan Kara
2021-10-06 17:31 ` [PATCH 4/8] bfq: Limit number of requests consumed by each cgroup Jan Kara
2021-11-02 18:16 ` Michal Koutný [this message]
2021-11-03 13:03 ` Jan Kara
2021-11-03 18:12 ` Michal Koutný
2021-11-04 11:20 ` Jan Kara
2021-10-06 17:31 ` [PATCH 5/8] bfq: Limit waker detection in time Jan Kara
2021-10-06 17:31 ` [PATCH 6/8] bfq: Provide helper to generate bfqq name Jan Kara
2021-10-06 17:31 ` [PATCH 7/8] bfq: Log waker detections Jan Kara
2021-10-06 17:31 ` [PATCH 8/8] bfq: Do not let waker requests skip proper accounting Jan Kara
2021-10-07 16:33 ` [PATCH 0/8 v3] bfq: Limit number of allocated scheduler tags per cgroup Paolo Valente
2021-10-25 7:58 ` Paolo Valente
2021-10-25 11:14 ` Jan Kara
2021-11-10 10:24 ` Paolo Valente
-- strict thread matches above, loose matches on Subject: below --
2021-11-23 10:29 [PATCH 0/8 v4] " Jan Kara
2021-11-23 10:29 ` [PATCH 4/8] bfq: Limit number of requests consumed by each cgroup Jan Kara
2021-11-25 13:36 [PATCH 0/8 v5] bfq: Limit number of allocated scheduler tags per cgroup Jan Kara
2021-11-25 13:36 ` [PATCH 4/8] bfq: Limit number of requests consumed by each cgroup Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211102181658.GA63407@blackbody.suse.cz \
--to=mkoutny@suse.com \
--cc=axboe@kernel.dk \
--cc=jack@suse.cz \
--cc=linux-block@vger.kernel.org \
--cc=paolo.valente@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox