qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Kevin Wolf <kwolf@redhat.com>,
	"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 08:37:37 +0300	[thread overview]
Message-ID: <9393f1f7-9939-4640-aa43-f7df042a8ee9@tls.msk.ru> (raw)
In-Reply-To: <20240206153105.81868-2-stefanha@redhat.com>

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.

(And yes I've seen it also included in another pullreq)

Thanks,

/mjt


  reply	other threads:[~2024-02-08  5:38 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 [this message]
2024-02-08  8:42     ` Kevin Wolf
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=9393f1f7-9939-4640-aa43-f7df042a8ee9@tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --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).