qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC 3/3] aio-posix: call ->poll_end() when removing AioHandler


From: Paolo Bonzini
Subject: Re: [RFC 3/3] aio-posix: call ->poll_end() when removing AioHandler
Date: Thu, 14 Dec 2023 21:39:02 +0100



Il gio 14 dic 2023, 21:12 Stefan Hajnoczi <stefanha@redhat.com> ha scritto:
Since the fd may be bypassed until ->io_poll_end() returns, we must poll
one last time to check if an event snuck in right at the end without
making the fd readable. If polling detected an event, then we must do
something. We cannot drop the event

I agree that in general we cannot. I wonder however if, in the (already racy) case of a concurrent aio_set_fd_handler(ctx, fd, NULL, ...), you really need to call poll_ready here.

(An alternative is to poll once before monitoring the fd again. That way
pending events are detected even if the fd wasn't readable. That is
currently not the way aio-posix.c works though.)

Yes, that would be a change. If I understood correctly Hanna's suggestions in the issue, she also mentioned doing a manual virtqueue notification before monitoring restarts. So basically my idea boils down to implementing that, and then cleaning up everything on top.

Paolo



Stefan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]