qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Czenczek <hreitz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, Fam Zheng <fam@euphon.net>,
	Fiona Ebner <f.ebner@proxmox.com>
Subject: Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler
Date: Tue, 2 Jan 2024 17:55:52 +0100	[thread overview]
Message-ID: <dd8f1223-1e84-4c24-abb8-e6019b0ac3d2@redhat.com> (raw)
In-Reply-To: <CABgObfZcB-0b7-dF1obyUqqdsgjy93d-1rGLaiExzRdZK9hHEA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]

On 02.01.24 16:53, Paolo Bonzini wrote:
> On Tue, Jan 2, 2024 at 4:24 PM Hanna Czenczek<hreitz@redhat.com>  wrote:
>> I’ve attached the preliminary patch that I didn’t get to send (or test
>> much) last year.  Not sure if it has the same CPU-usage-spike issue
>> Fiona was seeing, the only functional difference is that I notify the vq
>> after attaching the notifiers instead of before.
> I think the patch makes sense and cleaning up the logic of aio_poll
> (which is one of those functions that grew and grew without much
> clarity into who did what) can be done on top.
>
> Just one small thing, the virtio_queue_notify_vq() call is required
> because the virtqueue interrupt and eventfd are edge-triggered rather
> than level-triggered; so perhaps it should be placed in the
> function(s) that establish the handlers,
> virtio_queue_aio_attach_host_notifier() and
> virtio_queue_aio_attach_host_notifier_no_poll()? Neither
> virtio_blk_drained_end() nor virtio_scsi_drained_end() are
> particularly special, and the comment applies just as well:
>
>      /*
>       * We will have ignored notifications about new requests from the guest
>       * while handlers were not attached, so "kick" the virt queue to process
>       * those requests now.
>       */

I wasn’t entirely whether we want to call notify_vq() if we have 
instated the handlers for the first time (in which case someone ought to 
look for existing unprocessed requests anyway), so I decided to limit it 
to drained_end.

But considering that it must be safe to call notify_vq() right after 
instating the handlers (virtio_queue_host_notifier_read() may then be 
called after all), we might as well do so every time, yes.

Hanna

[-- Attachment #2: Type: text/html, Size: 2307 bytes --]

  reply	other threads:[~2024-01-02 16:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13 21:15 [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler Stefan Hajnoczi
2023-12-13 21:15 ` [RFC 1/3] aio-posix: run aio_set_fd_handler() in target AioContext Stefan Hajnoczi
2023-12-13 21:15 ` [RFC 2/3] aio: use counter instead of ctx->list_lock Stefan Hajnoczi
2023-12-13 21:15 ` [RFC 3/3] aio-posix: call ->poll_end() when removing AioHandler Stefan Hajnoczi
2023-12-13 21:52   ` Paolo Bonzini
2023-12-14 20:12     ` Stefan Hajnoczi
2023-12-14 20:39       ` Paolo Bonzini
2023-12-18 14:27         ` Stefan Hajnoczi
2023-12-13 21:52 ` [RFC 0/3] " Stefan Hajnoczi
2023-12-13 23:10 ` Paolo Bonzini
2023-12-14 19:52   ` Stefan Hajnoczi
2023-12-14 13:38 ` Fiona Ebner
2023-12-14 19:53   ` Stefan Hajnoczi
2023-12-18 12:41     ` Fiona Ebner
2023-12-18 14:25       ` Stefan Hajnoczi
2023-12-18 14:49       ` Paolo Bonzini
2023-12-19  8:40         ` Fiona Ebner
2024-01-02 15:24 ` Hanna Czenczek
2024-01-02 15:53   ` Paolo Bonzini
2024-01-02 16:55     ` Hanna Czenczek [this message]
2024-01-03 11:40   ` Fiona Ebner
2024-01-03 13:35     ` Paolo Bonzini
2024-01-05 13:43       ` Fiona Ebner
2024-01-05 14:30         ` Fiona Ebner
2024-01-22 17:41           ` Hanna Czenczek
2024-01-22 17:52             ` Hanna Czenczek
2024-01-23 11:12               ` Fiona Ebner
2024-01-23 11:25                 ` Hanna Czenczek
2024-01-23 11:15               ` Hanna Czenczek
2024-01-23 16:28   ` Hanna Czenczek

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=dd8f1223-1e84-4c24-abb8-e6019b0ac3d2@redhat.com \
    --to=hreitz@redhat.com \
    --cc=f.ebner@proxmox.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@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).