public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Paolo Valente <paolo.valente@linaro.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	ulf.hansson@linaro.org, linus.walleij@linaro.org,
	broonie@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH BUGFIX] block: add missing group association in bio_split
Date: Mon, 9 May 2016 11:20:06 -0400	[thread overview]
Message-ID: <20160509152006.GE7110@mtj.duckdns.org> (raw)
In-Reply-To: <1462567512-3007-1-git-send-email-paolo.valente@linaro.org>

On Fri, May 06, 2016 at 10:45:12PM +0200, Paolo Valente wrote:
> When a bio is split, the newly created bio must be associated with the
> same blkcg as the original bio (if BLK_CGROUP is enabled). If this
> operation is not performed, then the new bio is not associated with
> any group, and the group of the current task is returned when the
> group of the bio is requested.
> 
> Depending on the frequency of splits, this may cause a large
> percentage of the bios belonging to a given group to be treated as if
> belonging to other groups (in most cases as if belonging to the root
> group). The expected group isolation may thereby be then broken.
> 
> This commit adds the missing association in bio_split.
> 
> Signed-off-by: Paolo Valente <paolo.valente@linaro.org>

Acked-by: Tejun Heo <tj@kernel.org>

> ---
>  block/bio.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/block/bio.c b/block/bio.c
> index 807d25e..c4a3834 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -1811,6 +1811,11 @@ struct bio *bio_split(struct bio *bio, int sectors,
>  
>  	bio_advance(bio, split->bi_iter.bi_size);
>  
> +#ifdef CONFIG_BLK_CGROUP
> +	if (bio->bi_css)
> +		bio_associate_blkcg(split, bio->bi_css);
> +#endif

And yeah, we need to encapsulate this better to avoid scattering
CONFIG_BLK_CGROUP but that's for another patch.

Thanks.

-- 
tejun

      parent reply	other threads:[~2016-05-09 15:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 20:45 [PATCH BUGFIX] block: add missing group association in bio_split Paolo Valente
2016-05-09 14:19 ` Jeff Moyer
2016-05-09 14:35   ` Jeff Moyer
2016-05-09 14:39     ` Paolo
2016-05-09 14:55       ` Jens Axboe
2016-05-09 14:56       ` Mark Brown
2016-05-09 17:58         ` Jens Axboe
2016-05-09 15:20 ` Tejun Heo [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=20160509152006.GE7110@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=broonie@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paolo.valente@linaro.org \
    --cc=stable@vger.kernel.org \
    --cc=ulf.hansson@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