[PATCH 0/1] block: Do not poll in bdrv_set_aio_context_ignore() when acquiring new_context

Zhiyong Ye posted 1 patch 4 years, 7 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210712053831.51722-1-yezhiyong@bytedance.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
block.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[PATCH 0/1] block: Do not poll in bdrv_set_aio_context_ignore() when acquiring new_context
Posted by Zhiyong Ye 4 years, 7 months ago
When bdrv_set_aio_context_ignore() is called in the main loop to change
the AioContext onto the IO thread, the bdrv_drain_invoke_entry() never
gets to run and the IO thread hangs at co_schedule_bh_cb().

This is because the AioContext is occupied by the main thread after
being attached to the IO thread, and the main thread poll in
bdrv_drained_end() waiting for the IO request to be drained, but the IO
thread cannot acquire the AioContext, which leads to deadlock.

Zhiyong Ye (1):
  block: Do not poll in bdrv_set_aio_context_ignore() when acquiring new_context

 block.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.11.0