mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>
Cc: linux-kernel@vger.kernel.org, axboe@kernel.dk
Subject: Re: [PATCH] blk-throttle: fix race between submitter and throttler thread
Date: Thu, 20 May 2021 11:00:27 -0400	[thread overview]
Message-ID: <YKZ5i5P8fL8bgq7G@slm.duckdns.org> (raw)
In-Reply-To: <20210513082827.1818-1-dmtrmonakhov@yandex-team.ru>

Hello, Dmitry.

This generally looks good to me. A couple nits below.

> @@ -277,6 +277,8 @@ static struct bio *__bio_chain_endio(struct bio *bio)
>  {
>  	struct bio *parent = bio->bi_private;
>  
> +	BUG_ON(!bio_flagged(parent, BIO_CHAIN));

Let's do WARN_ON_ONCE().

> @@ -2270,6 +2285,8 @@ bool blk_throtl_bio(struct bio *bio)
>  
>  	td->nr_queued[rw]++;
>  	throtl_add_bio_tg(bio, qn, tg);

Can you add some comment here explaining how now that the bio is added for
throttling, there are two accessors of it and the bio must not be modified
without holding the lock?

Thank you.

-- 
tejun

  reply	other threads:[~2021-05-20 15:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13  8:28 Dmitry Monakhov
2021-05-20 15:00 ` Tejun Heo [this message]
2021-05-20 17:00   ` Dmitry Monakhov
2021-05-20 17:07     ` Tejun Heo

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=YKZ5i5P8fL8bgq7G@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=dmtrmonakhov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®