[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 5/5] block-coroutine-wrapper: use qemu_get_current_aio_con
From: |
Eric Blake |
Subject: |
Re: [PATCH v3 5/5] block-coroutine-wrapper: use qemu_get_current_aio_context() |
Date: |
Wed, 13 Sep 2023 11:23:48 -0500 |
User-agent: |
NeoMutt/20230517 |
On Tue, Sep 12, 2023 at 07:10:37PM -0400, Stefan Hajnoczi wrote:
> Use qemu_get_current_aio_context() in mixed wrappers and coroutine
> wrappers so that code runs in the caller's AioContext instead of moving
> to the BlockDriverState's AioContext. This change is necessary for the
> multi-queue block layer where any thread can call into the block layer.
>
> Most wrappers are IO_CODE where it's safe to use the current AioContext
> nowadays. BlockDrivers and the core block layer use their own locks and
> no longer depend on the AioContext lock for thread-safety.
>
> The bdrv_create() wrapper invokes GLOBAL_STATE code. Using the current
> AioContext is safe because this code is only called with the BQL held
> from the main loop thread.
>
> The output of qemu-iotests 051 is sensitive to event loop activity.
> Update the output because the monitor BH runs at a different time,
> causing prompts to be printed differently in the output.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> scripts/block-coroutine-wrapper.py | 6 ++----
> tests/qemu-iotests/051.pc.out | 4 ++--
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
- Re: [PATCH v3 1/5] block: remove AIOCBInfo->get_aio_context(), (continued)
- [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 5/5] block-coroutine-wrapper: use qemu_get_current_aio_context(),
Eric Blake <=
- Re: [PATCH v3 0/5] block-backend: process I/O in the current AioContext, Kevin Wolf, 2023/09/15