From: Kevin Wolf <kwolf@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Hanna Reitz <hreitz@redhat.com>,
qemu-block@nongnu.org, qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [PULL 1/1] virtio-blk: avoid using ioeventfd state in irqfd conditional
Date: Thu, 8 Feb 2024 09:42:02 +0100 [thread overview]
Message-ID: <ZcST2jDqvZWhgp2E@redhat.com> (raw)
In-Reply-To: <9393f1f7-9939-4640-aa43-f7df042a8ee9@tls.msk.ru>
Am 08.02.2024 um 06:37 hat Michael Tokarev geschrieben:
> 06.02.2024 18:31, Stefan Hajnoczi :
> > Requests that complete in an IOThread use irqfd to notify the guest
> > while requests that complete in the main loop thread use the traditional
> > qdev irq code path. The reason for this conditional is that the irq code
> > path requires the BQL:
> >
> > if (s->ioeventfd_started && !s->ioeventfd_disabled) {
> > virtio_notify_irqfd(vdev, req->vq);
> > } else {
> > virtio_notify(vdev, req->vq);
> > }
> >
> > There is a corner case where the conditional invokes the irq code path
> > instead of the irqfd code path:
> >
> > static void virtio_blk_stop_ioeventfd(VirtIODevice *vdev)
> > {
> > ...
> > /*
> > * Set ->ioeventfd_started to false before draining so that host notifiers
> > * are not detached/attached anymore.
> > */
> > s->ioeventfd_started = false;
> >
> > /* Wait for virtio_blk_dma_restart_bh() and in flight I/O to complete */
> > blk_drain(s->conf.conf.blk);
> >
> > During blk_drain() the conditional produces the wrong result because
> > ioeventfd_started is false.
> >
> > Use qemu_in_iothread() instead of checking the ioeventfd state.
> >
> > Buglink: https://issues.redhat.com/browse/RHEL-15394
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > Message-id: 20240122172625.415386-1-stefanha@redhat.com
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
>
> Cc qemu-stable? This smells like a stable material, please let me know
> if it is not.
The patch email itself was CCed to qemu-stable and even contained a note
for backporting to stable:
https://lists.gnu.org/archive/html/qemu-block/2024-01/msg00278.html
It's only missing in the commit message. I'll add the Cc: line to
my pull request (for Stefan's pull request it seems too late because
Peter is already processing it, so we'll probably end up having both
versions in the git history).
Kevin
next prev parent reply other threads:[~2024-02-08 8:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-06 15:31 [PULL 0/1] Block patches Stefan Hajnoczi
2024-02-06 15:31 ` [PULL 1/1] virtio-blk: avoid using ioeventfd state in irqfd conditional Stefan Hajnoczi
2024-02-08 5:37 ` Michael Tokarev
2024-02-08 8:42 ` Kevin Wolf [this message]
2024-02-08 9:01 ` Michael Tokarev
2024-02-07 22:19 ` [PULL 0/1] Block patches Kevin Wolf
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=ZcST2jDqvZWhgp2E@redhat.com \
--to=kwolf@redhat.com \
--cc=hreitz@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=stefanha@redhat.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;
as well as URLs for NNTP newsgroup(s).