From: Jens Axboe <axboe@kernel.dk>
To: Carlo Nonato <carlo.nonato95@gmail.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
bfq-iosched@googlegroups.com, oleksandr@natalenko.name,
Kwon Je Oh <kwonje.oh2@gmail.com>
Subject: Re: [PATCH BUGFIX] block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group()
Date: Fri, 6 Mar 2020 07:01:16 -0700 [thread overview]
Message-ID: <a5e49715-6098-41d5-f964-9e6c4ff5e602@kernel.dk> (raw)
In-Reply-To: <20200306122731.5945-1-carlo.nonato95@gmail.com>
On 3/6/20 5:27 AM, Carlo Nonato wrote:
> The bfq_find_set_group() function takes as input a blkcg (which represents
> a cgroup) and retrieves the corresponding bfq_group, then it updates the
> bfq internal group hierarchy (see comments inside the function for why
> this is needed) and finally it returns the bfq_group.
> In the hierarchy update cycle, the pointer holding the correct bfq_group
> that has to be returned is mistakenly used to traverse the hierarchy
> bottom to top, meaning that in each iteration it gets overwritten with the
> parent of the current group. Since the update cycle stops at root's
> children (depth = 2), the overwrite becomes a problem only if the blkcg
> describes a cgroup at a hierarchy level deeper than that (depth > 2). In
> this case the root's child that happens to be also an ancestor of the
> correct bfq_group is returned. The main consequence is that processes
> contained in a cgroup at depth greater than 2 are wrongly placed in the
> group described above by BFQ.
>
> This commits fixes this problem by using a different bfq_group pointer in
> the update cycle in order to avoid the overwrite of the variable holding
> the original group reference.
Applied, thanks.
--
Jens Axboe
prev parent reply other threads:[~2020-03-06 14:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 12:27 [PATCH BUGFIX] block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group() Carlo Nonato
2020-03-06 14:01 ` Jens Axboe [this message]
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=a5e49715-6098-41d5-f964-9e6c4ff5e602@kernel.dk \
--to=axboe@kernel.dk \
--cc=bfq-iosched@googlegroups.com \
--cc=carlo.nonato95@gmail.com \
--cc=kwonje.oh2@gmail.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleksandr@natalenko.name \
/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;
as well as URLs for NNTP newsgroup(s).