All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: Re: [PATCH] block: don't protect submit_bio_checks by q_usage_counter
Date: Tue, 11 Jan 2022 09:16:14 +0800	[thread overview]
Message-ID: <YdzaXp4DVyCP6lKS@T590> (raw)
In-Reply-To: <20220110164909.GA7372@lst.de>

On Mon, Jan 10, 2022 at 05:49:09PM +0100, Christoph Hellwig wrote:
> On Tue, Jan 04, 2022 at 09:42:23PM +0800, Ming Lei wrote:
> > Commit cc9c884dd7f4 ("block: call submit_bio_checks under q_usage_counter")
> > uses q_usage_counter to protect submit_bio_checks for avoiding IO after
> > disk is deleted by del_gendisk().
> > 
> > Turns out the protection isn't necessary, because once
> > blk_mq_freeze_queue_wait() in del_gendisk() returns:
> > 
> > 1) all in-flight IO has been done
> 
> Only for blk-mq drivers.

Yes, but the q_usage_counter protection for bio based queue is just for
calling ->submit_bio(), which is added in:

3ef28e83ab15 block: generic request_queue reference counting

Also we never support to drain in-flight IO for bio based queue, and
this patch doesn't make a difference on this area.

> 
> So I don't think this is actually safe.

Draining bio based queue is always driver's responsibility, block
layer never supports that.


Thanks,
Ming


      reply	other threads:[~2022-01-11  1:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 13:42 [PATCH] block: don't protect submit_bio_checks by q_usage_counter Ming Lei
2022-01-10  0:05 ` Ming Lei
2022-01-10  1:56 ` Jens Axboe
2022-01-10  1:59 ` Jens Axboe
2022-01-10 16:49 ` Christoph Hellwig
2022-01-11  1:16   ` Ming Lei [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=YdzaXp4DVyCP6lKS@T590 \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.