diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-07-04 18:33:20 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2016-07-18 15:09:31 +0100 |
commit | 0187f5c9cb172771ba85c66e3bf61f8cde6d6561 (patch) | |
tree | 18529868935e436847aa696c35792c116d24af0e /include/block/aio.h | |
parent | 4e90ccc28e53eb92ecbd0cdb67da454d783ea828 (diff) |
linux-aio: share one LinuxAioState within an AioContext
This has better performance because it executes fewer system calls
and does not use a bottom half per disk.
Originally proposed by Ming Lei.
[Changed #include "raw-aio.h" to "block/raw-aio.h" in win32-aio.c to fix
build error as reported by Peter Maydell <peter.maydell@linaro.org>.
--Stefan]
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1467650000-51385-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
squash! linux-aio: share one LinuxAioState within an AioContext
Diffstat (limited to 'include/block/aio.h')
-rw-r--r-- | include/block/aio.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/block/aio.h b/include/block/aio.h index 88a64eeb3c..afd72a7516 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -47,6 +47,9 @@ typedef struct AioHandler AioHandler; typedef void QEMUBHFunc(void *opaque); typedef void IOHandler(void *opaque); +struct ThreadPool; +struct LinuxAioState; + struct AioContext { GSource source; @@ -119,6 +122,13 @@ struct AioContext { /* Thread pool for performing work and receiving completion callbacks */ struct ThreadPool *thread_pool; +#ifdef CONFIG_LINUX_AIO + /* State for native Linux AIO. Uses aio_context_acquire/release for + * locking. + */ + struct LinuxAioState *linux_aio; +#endif + /* TimerLists for calling timers - one per clock type */ QEMUTimerListGroup tlg; @@ -335,6 +345,9 @@ GSource *aio_get_g_source(AioContext *ctx); /* Return the ThreadPool bound to this AioContext */ struct ThreadPool *aio_get_thread_pool(AioContext *ctx); +/* Return the LinuxAioState bound to this AioContext */ +struct LinuxAioState *aio_get_linux_aio(AioContext *ctx); + /** * aio_timer_new: * @ctx: the aio context |