From: Stefan Hajnoczi <stefanha@redhat.com>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Yi Sun <yi.sun@unisoc.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
virtualization@lists.linux.dev,
Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH] virtio-blk: don't keep queue frozen during system suspend
Date: Wed, 4 Dec 2024 16:31:51 -0500 [thread overview]
Message-ID: <20241204213151.GF48585@fedora> (raw)
In-Reply-To: <20241112125821.1475793-1-ming.lei@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]
On Tue, Nov 12, 2024 at 08:58:21PM +0800, Ming Lei wrote:
> Commit 4ce6e2db00de ("virtio-blk: Ensure no requests in virtqueues before
> deleting vqs.") replaces queue quiesce with queue freeze in virtio-blk's
> PM callbacks. And the motivation is to drain inflight IOs before suspending.
>
> block layer's queue freeze looks very handy, but it is also easy to cause
> deadlock, such as, any attempt to call into bio_queue_enter() may run into
> deadlock if the queue is frozen in current context. There are all kinds
> of ->suspend() called in suspend context, so keeping queue frozen in the
> whole suspend context isn't one good idea. And Marek reported lockdep
> warning[1] caused by virtio-blk's freeze queue in virtblk_freeze().
>
> [1] https://lore.kernel.org/linux-block/ca16370e-d646-4eee-b9cc-87277c89c43c@samsung.com/
>
> Given the motivation is to drain in-flight IOs, it can be done by calling
> freeze & unfreeze, meantime restore to previous behavior by keeping queue
> quiesced during suspend.
>
> Cc: Yi Sun <yi.sun@unisoc.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> Cc: virtualization@lists.linux.dev
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
> drivers/block/virtio_blk.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2024-12-04 21:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 12:58 [PATCH] virtio-blk: don't keep queue frozen during system suspend Ming Lei
2024-12-04 21:31 ` Stefan Hajnoczi [this message]
2024-12-05 17:00 ` Jens Axboe
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=20241204213151.GF48585@fedora \
--to=stefanha@redhat.com \
--cc=axboe@kernel.dk \
--cc=jasowang@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=ming.lei@redhat.com \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=yi.sun@unisoc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox