qemu/include/block
Paolo Bonzini 0ceb849bd3 AioContext: speed up aio_notify
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>
2014-07-09 15:50:11 +02:00
..
aio.h AioContext: speed up aio_notify 2014-07-09 15:50:11 +02:00
block_int.h block: block: introduce APIs for submitting IO as a batch 2014-07-07 11:05:17 +02:00
block.h block: block: introduce APIs for submitting IO as a batch 2014-07-07 11:05:17 +02:00
blockjob.h block: drop aio functions that operate on the main AioContext 2014-07-09 15:50:11 +02:00
coroutine_int.h coroutine: stop using AioContext in CoQueue 2013-05-24 16:17:56 +02:00
coroutine.h block: drop aio functions that operate on the main AioContext 2014-07-09 15:50:11 +02:00
nbd.h nbd: Handle NBD_OPT_LIST option. 2014-06-30 12:50:17 +02:00
qapi.h block: make bdrv_query_stats() static 2014-06-27 18:19:57 +02:00
scsi.h scsi: Print command name in debug 2014-06-18 08:47:10 +02:00
snapshot.h qemu-nbd: support internal snapshot export 2013-12-04 15:19:00 +01:00
thread-pool.h threadpool: drop global thread pool 2013-03-15 16:07:51 +01:00