[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] block/nfs: avoid BDRV_POLL_WHILE() in nfs_co_get_allocated_f
From: |
Kevin Wolf |
Subject: |
Re: [PATCH] block/nfs: avoid BDRV_POLL_WHILE() in nfs_co_get_allocated_file_size() |
Date: |
Thu, 27 Apr 2023 14:54:43 +0200 |
Am 04.04.2023 um 01:30 hat Stefan Hajnoczi geschrieben:
> Commit 82618d7bc341 ("block: Convert bdrv_get_allocated_file_size() to
> co_wrapper") made nfs_get_allocated_file_size() a coroutine. The
> coroutine still uses BDRV_POLL_WHILE() to wait for the NFS RPC to
> complete.
>
> Take it a step further and yield the coroutine until the RPC completes.
> This avoids the blocking, nested event loop and unifies
> nfs_co_get_allocated_file_size() with the other coroutine functions that
> send RPCs:
> - Use nfs_co_init_task() to set up a coroutine NFSRPC task.
> - Take client->mutex to protect fd handler state since we're in IO_CODE.
> - Use nfs_co_generic_cb() instead of a specialized callback function.
> - Yield until the task completes.
>
> Getting rid of BDRV_POLL_WHILE() helps with the multi-queue block layer
> effort where we don't want to take the AioContext lock.
>
> This commit passes qemu-iotests/check -nfs, except inactivate-failure,
> which also fails before this commit.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This conflicts with Paolo's commit 3fe64abc, which seems to address the
same bug. Your patch does some more cleanup like removing
nfs_get_allocated_file_size_cb() in favour of nfs_co_generic_cb().
Do you want to rebase and send the remaining pieces as a cleanup patch?
Kevin