|
From: | Paolo Bonzini |
Subject: | Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler |
Date: | Wed, 3 Jan 2024 14:35:44 +0100 |
User-agent: | Mozilla Thunderbird |
On 1/3/24 12:40, Fiona Ebner wrote:
I'm happy to report that I cannot reproduce the CPU-usage-spike issue with the patch, but I did run into an assertion failure when trying to verify that it fixes my original stuck-guest-IO issue. See below for the backtrace [0]. Hanna wrote in https://issues.redhat.com/browse/RHEL-3934I think it’s sufficient to simply call virtio_queue_notify_vq(vq) after the virtio_queue_aio_attach_host_notifier(vq, ctx) call, because both virtio-scsi’s and virtio-blk’s .handle_output() implementations acquire the device’s context, so this should be directly callable from any context.I guess this is not true anymore now that the AioContext locking was removed?
Good point and, in fact, even before it was much safer to use virtio_queue_notify() instead. Not only does it use the event notifier handler, but it also calls it in the right thread/AioContext just by doing event_notifier_set().
The call to virtio_queue_set_notification(..., 1) is safe; not sure about the call to virtio_queue_set_notification(..., 0) though. I'd rather have that executed synchronously in the AioContext using aio_wait_bh_oneshot(). This is consistent with the pattern used by virtio_scsi_dataplane_stop() and virtio_blk_data_plane_stop().
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |