History | View | Annotate | Download (7.8 kB)
aio: switch aiocb_size type int -> size_t
Using appropriate types for variables is a good thing :). All userssimply do sizeof(MyType) and the value is passed to a memory allocator,it should be size_t.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>...
aio: use g_slice_alloc() for AIOCB pooling
AIO control blocks are frequently acquired and released because each aiorequest involves at least one AIOCB. Therefore, we pool them to avoidheap allocation overhead.
The problem with the freelist approach in AIOPool is thread-safety. If...
aio: rename AIOPool to AIOCBInfo
Now that AIOPool no longer keeps a freelist, it isn't really a "pool" anymore. Rename it to AIOCBInfo and make it const since it no longerneeds to be modified.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
aio: clean up now-unused functions
Some cleanups can now be made, now that the main loop does not anymore needhooks into the bottom half code.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
aio: introduce AioContext, move bottom halves there
Start introducing AioContext, which will let us remove globals fromaio.c/async.c, and introduce multiple I/O threads.
The bottom half functions now take an additional AioContext argument.A bottom half is created with a specific AioContext that remains the...
aio: add I/O handlers to the AioContext interface
With this patch, I/O handlers (including event notifier handlers) can beattached to a single AioContext.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
aio: add non-blocking variant of aio_wait
This will be used when polling the GSource attached to an AioContext.
aio: prepare for introducing GSource-based dispatch
This adds a GPollFD to each AioHandler. It will then be possible toattach these GPollFDs to a GSource, and from there to the main loop.aio_wait examines the GPollFDs and avoids calling select() if any...
aio: make AioContexts GSources
This lets AioContexts be used (optionally) with a glib main loop.
aio: add aio_notify
With this change async.c does not rely anymore on any service frommain-loop.c, i.e. it is completely self-contained.
aio: change qemu_aio_set_fd_handler to return void
aio: provide platform-independent API
This adds to aio.c a platform-independent API based on EventNotifiers, thatcan be used by both POSIX and Win32.
aio: return "AIO in progress" state from qemu_aio_wait
The definition of when qemu_aio_flush should loop is much simplerthan it looks. It just has to call qemu_aio_wait until it makesno progress and all flush callbacks return false. qemu_aio_waitis the logical place to tell the caller about this....
aio: remove process_queue callback and qemu_aio_process_queue
Both unused after the previous patch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
aio: move BlockDriverAIOCB to qemu-aio.h
And remove several block_int.h inclusions that should not be there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Add qemu_aio_process_queue()
We'll leave some AIO completions unhandled when we can't call the callback.qemu_aio_process_queue() is used later to run any callbacks that are left andcan be run then.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
fix qemu_aio_flush
qemu_aio_wait by invoking the bh or one of the aio completioncallbacks, could end up submitting new pending aio, breaking theinvariant that qemu_aio_flush returns only when no pending aio isoutstanding (possibly a problem for migration as such)....
Refactor AIO to allow multiple AIO implementations
This patch refactors the AIO layer to allow multiple AIO implementations. It'sonly possible because of the recent signalfd() patch.
Right now, the AIO infrastructure is pretty specific to the block raw backend....