qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] coroutine: avoid co_queue_wakeup recursion
@ 2018-03-22 15:28 Stefan Hajnoczi
  2018-03-22 15:28 ` [Qemu-devel] [PATCH 1/3] queue: add QSIMPLEQ_PREPEND() Stefan Hajnoczi
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2018-03-22 15:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-block, Kevin Wolf, Paolo Bonzini, Stefan Hajnoczi, Fam Zheng,
	Max Reitz

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(-)

-- 
2.14.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-27 12:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-22 15:28 [Qemu-devel] [PATCH 0/3] coroutine: avoid co_queue_wakeup recursion Stefan Hajnoczi
2018-03-22 15:28 ` [Qemu-devel] [PATCH 1/3] queue: add QSIMPLEQ_PREPEND() Stefan Hajnoczi
2018-03-22 15:28 ` [Qemu-devel] [PATCH 2/3] coroutine: avoid co_queue_wakeup recursion Stefan Hajnoczi
2018-03-22 15:28 ` [Qemu-devel] [PATCH 3/3] coroutine: add test-aio coroutine queue chaining test case Stefan Hajnoczi
2018-03-22 16:41 ` [Qemu-devel] [PATCH 0/3] coroutine: avoid co_queue_wakeup recursion Paolo Bonzini
2018-03-27 12:11 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).