0ceb849bd3
In many cases, the call to event_notifier_set in aio_notify is unnecessary. In particular, if we are executing aio_dispatch, or if aio_poll is not blocking, we know that we will soon get to the next loop iteration (if necessary); the thread that hosts the AioContext's event loop does not need any nudging. The patch includes a Promela formal model that shows that this really works and does not need any further complication such as generation counts. It needs a memory barrier though. The generation counts are not needed because any change to ctx->dispatching after the memory barrier is okay for aio_notify. If it changes from zero to one, it is the right thing to skip event_notifier_set. If it changes from one to zero, the event_notifier_set is unnecessary but harmless. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> |
||
---|---|---|
.. | ||
qmp | ||
specs | ||
aio_notify.promela | ||
atomics.txt | ||
blkverify.txt | ||
bootindex.txt | ||
ccid.txt | ||
ich9-ehci-uhci.cfg | ||
libcacard.txt | ||
live-block-ops.txt | ||
memory.txt | ||
migration.txt | ||
multiseat.txt | ||
q35-chipset.cfg | ||
qapi-code-gen.txt | ||
qdev-device-use.txt | ||
qemupciserial.inf | ||
rdma.txt | ||
spice-port-fqdn.txt | ||
tracing.txt | ||
usb2.txt | ||
usb-storage.txt | ||
virtio-balloon-stats.txt | ||
vnc-ledstate-Pseudo-encoding.txt | ||
writing-qmp-commands.txt | ||
xbzrle.txt | ||
xen-save-devices-state.txt |