From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
qemu-stable@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
Hanna Reitz <hreitz@redhat.com>
Subject: Re: [PATCH] virtio-blk: avoid using ioeventfd state in irqfd conditional
Date: Wed, 7 Feb 2024 22:00:12 +0100 [thread overview]
Message-ID: <ZcPvXIFTI2X0aNwk@redhat.com> (raw)
In-Reply-To: <20240122172625.415386-1-stefanha@redhat.com>
Am 22.01.2024 um 18:26 hat Stefan Hajnoczi geschrieben:
> 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>
Thanks, applied to the block branch.
Kevin
prev parent reply other threads:[~2024-02-07 21:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-22 17:26 [PATCH] virtio-blk: avoid using ioeventfd state in irqfd conditional Stefan Hajnoczi
2024-01-30 21:56 ` Stefan Hajnoczi
2024-02-07 21:00 ` Kevin Wolf [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=ZcPvXIFTI2X0aNwk@redhat.com \
--to=kwolf@redhat.com \
--cc=hreitz@redhat.com \
--cc=mst@redhat.com \
--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).