Skip to content

coroutine: avoid co_queue_wakeup recursion

Stefan Hajnoczi qemu-devel 1 version Applied

Status from this message: Thanks, applied to my block tree:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3queue: add QSIMPLEQ_PREPEND()include/qemu/queue.h+8 -00 replies
2/3coroutine: avoid co_queue_wakeup recursionblock/io.c include/qemu/coroutine_int.h util/qemu-coroutine-lock.c +1 more+60 -880 replies
3/3coroutine: add test-aio coroutine queue chaining test casetests/test-aio.c+52 -130 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPaolo Bonzini
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/3] coroutine: avoid co_queue_wakeup recursion

co_queue_wakeup is currently implemented in a recursive fashion. Pathological patterns of aio_co_enter() between coroutines can cause stack exhaustion.

This patch series implements co_queue_wakeup iteratively and avoids stack exhaustion.

This issue was originally reported with qemu-img convert but I don't have a good reproducer. See Patch 3 for a test-aio test case instead.

Stefan Hajnoczi (3):
queue: add QSIMPLEQ_PREPEND()
coroutine: avoid co_queue_wakeup recursion
coroutine: add test-aio coroutine queue chaining test case

 include/qemu/coroutine_int.h |   1 -
 include/qemu/queue.h         |   8 ++++
 block/io.c                   |   3 +-
 tests/test-aio.c             |  65 ++++++++++++++++++++-----
 util/qemu-coroutine-lock.c   |  34 -------------
 util/qemu-coroutine.c        | 110 +++++++++++++++++++++++--------------------
 6 files changed, 120 insertions(+), 101 deletions(-)
Signature · 1 line
2.14.3