All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Nilay Shroff <nilay@linux.ibm.com>,
	syzbot+9dd7dbb1a4b915dee638@syzkaller.appspotmail.com
Subject: Re: [PATCH] loop: replace freezing queue with quiesce when changing loop specific setting
Date: Tue, 8 Apr 2025 07:23:57 +0200	[thread overview]
Message-ID: <20250408052357.GA32561@lst.de> (raw)
In-Reply-To: <Z_PnCUw0eeVdwxxy@fedora>

On Mon, Apr 07, 2025 at 10:54:01PM +0800, Ming Lei wrote:
> > What are "internal settings" please?  If you change the loop backing
> > file outstanding I/O is relevant.  If you change NVMe ANA or retry
> > policies are relevant as they are checked in the I/O completion handler.
> 
> internal setting means the driver internal setting, which is only visible
> for driver.
> 
> Here this setting(lo_offset, backing file, dio, ...) won't be used in
> completion handler, so it is fine to use quiesce here for updating
> these loop specific setting.

The backing file is used during I/O.  So you certainly can't change
it while I/O is in flight.

But the important point is that there is nothing inherent about
"internal" attributes needing different synchronization.  Maybe some
field don't need a full I/O quiesce, but you need to explain that
for each and every single one of them.

> 
> > 
> > > > This also misses an explanation of what setting this protects and why
> > > > you think this is safe and the sound fix.
> > > 
> > > 1) it is typical queue quiesce use case
> > 
> > What is the typical queue quiesce use case?  Why is it "typical" and
> > why is it safe.
> 
> typical quiesce provides sync with driver's ->queue_rq(), and it is typical
> that these driver settings are only used in driver submission code path.

"typical" does not matter.  The required synchronization needs to be
provided even for non-typical use cases.

> > > 3) for driver, quiesce is always preferred over freeze, and freeze is
> > > easily mis-used by driver, you know we have bad driver uses for freeze.
> > 
> > I am actually much more worried about quiesce.  It is much less well
> > defined.
> 
> It is widely used, and please see document of blk_mq_quiesce_queue().

I did not say it isn't widely used.  Which is part of the problem.


      reply	other threads:[~2025-04-08  5:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03 10:54 [PATCH] loop: replace freezing queue with quiesce when changing loop specific setting Ming Lei
2025-04-03 20:04 ` Zhu Yanjun
2025-04-04  9:11 ` Christoph Hellwig
2025-04-04 12:06   ` Ming Lei
2025-04-07  6:48     ` Christoph Hellwig
2025-04-07 14:54       ` Ming Lei
2025-04-08  5:23         ` Christoph Hellwig [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=20250408052357.GA32561@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=nilay@linux.ibm.com \
    --cc=syzbot+9dd7dbb1a4b915dee638@syzkaller.appspotmail.com \
    /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.