[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/5] block: remove AIOCBInfo->get_aio_context()
From: |
Klaus Jensen |
Subject: |
Re: [PATCH v3 1/5] block: remove AIOCBInfo->get_aio_context() |
Date: |
Thu, 14 Sep 2023 08:44:59 +0200 |
On Sep 12 19:10, Stefan Hajnoczi wrote:
> The synchronous bdrv_aio_cancel() function needs the acb's AioContext so
> it can call aio_poll() to wait for cancellation.
>
> It turns out that all users run under the BQL in the main AioContext, so
> this callback is not needed.
>
> Remove the callback, mark bdrv_aio_cancel() GLOBAL_STATE_CODE just like
> its blk_aio_cancel() caller, and poll the main loop AioContext.
>
> The purpose of this cleanup is to identify bdrv_aio_cancel() as an API
> that does not work with the multi-queue block layer.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> include/block/aio.h | 1 -
> include/block/block-global-state.h | 2 ++
> include/block/block-io.h | 1 -
> block/block-backend.c | 17 -----------------
> block/io.c | 23 ++++++++---------------
> hw/nvme/ctrl.c | 7 -------
> softmmu/dma-helpers.c | 8 --------
> util/thread-pool.c | 8 --------
> 8 files changed, 10 insertions(+), 57 deletions(-)
>
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index 539d273553..ee7273daa1 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -2130,11 +2130,6 @@ static inline bool nvme_is_write(NvmeRequest *req)
> rw->opcode == NVME_CMD_WRITE_ZEROES;
> }
>
> -static AioContext *nvme_get_aio_context(BlockAIOCB *acb)
> -{
> - return qemu_get_aio_context();
> -}
> -
> static void nvme_misc_cb(void *opaque, int ret)
> {
> NvmeRequest *req = opaque;
> @@ -3302,7 +3297,6 @@ static void nvme_flush_cancel(BlockAIOCB *acb)
> static const AIOCBInfo nvme_flush_aiocb_info = {
> .aiocb_size = sizeof(NvmeFlushAIOCB),
> .cancel_async = nvme_flush_cancel,
> - .get_aio_context = nvme_get_aio_context,
> };
>
> static void nvme_do_flush(NvmeFlushAIOCB *iocb);
> @@ -6478,7 +6472,6 @@ static void nvme_format_cancel(BlockAIOCB *aiocb)
> static const AIOCBInfo nvme_format_aiocb_info = {
> .aiocb_size = sizeof(NvmeFormatAIOCB),
> .cancel_async = nvme_format_cancel,
> - .get_aio_context = nvme_get_aio_context,
> };
>
> static void nvme_format_set(NvmeNamespace *ns, uint8_t lbaf, uint8_t mset,
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
signature.asc
Description: PGP signature
- [PATCH v3 0/5] block-backend: process I/O in the current AioContext, Stefan Hajnoczi, 2023/09/12
- [PATCH v3 1/5] block: remove AIOCBInfo->get_aio_context(), Stefan Hajnoczi, 2023/09/12
- [PATCH v3 2/5] test-bdrv-drain: avoid race with BH in IOThread drain test, Stefan Hajnoczi, 2023/09/12
- [PATCH v3 3/5] block-backend: process I/O in the current AioContext, Stefan Hajnoczi, 2023/09/12
- [PATCH v3 4/5] block-backend: process zoned requests in the current AioContext, Stefan Hajnoczi, 2023/09/12
- [PATCH v3 5/5] block-coroutine-wrapper: use qemu_get_current_aio_context(), Stefan Hajnoczi, 2023/09/12
- Re: [PATCH v3 0/5] block-backend: process I/O in the current AioContext, Kevin Wolf, 2023/09/15