On 08.11.22 13:37, Kevin Wolf wrote:
Polling during bdrv_drained_end() can be problematic (and in the future,
we may get cases for bdrv_drained_begin() where polling is forbidden,
and we don't care about already in-flight requests, but just want to
prevent new requests from arriving).
The .bdrv_drained_begin/end callbacks running in a coroutine is the only
reason why we have to do this polling, so make them non-coroutine
callbacks again. None of the callers actually yield any more.
This means that bdrv_drained_end() effectively doesn't poll any more,
even if AIO_WAIT_WHILE() loops are still there (their condition is false
from the beginning). This is generally not a problem, but in
test-bdrv-drain, some additional explicit aio_poll() calls need to be
added because the test case wants to verify the final state after BHs
have executed.
Signed-off-by: Kevin Wolf <kw...@redhat.com>
---
include/block/block_int-common.h | 10 ++++---
block.c | 4 +--
block/io.c | 49 +++++---------------------------
block/qed.c | 4 +--
block/throttle.c | 6 ++--
tests/unit/test-bdrv-drain.c | 18 ++++++------
6 files changed, 30 insertions(+), 61 deletions(-)
As the others have already suggested, I’d too drop the _co_ in qed and
throttle, and the coroutine_fn in throttle. With that done:
Reviewed-by: Hanna Reitz <hre...@redhat.com>