qemu-e2k/include/qemu
Stefan Hajnoczi c40a254570 coroutine: avoid co_queue_wakeup recursion
qemu_aio_coroutine_enter() is (indirectly) called recursively when
processing co_queue_wakeup.  This can lead to stack exhaustion.

This patch rewrites co_queue_wakeup in an iterative fashion (instead of
recursive) with bounded memory usage to prevent stack exhaustion.

qemu_co_queue_run_restart() is inlined into qemu_aio_coroutine_enter()
and the qemu_coroutine_enter() call is turned into a loop to avoid
recursion.

There is one change that is worth mentioning:  Previously, when
coroutine A queued coroutine B, qemu_co_queue_run_restart() entered
coroutine B from coroutine A.  If A was terminating then it would still
stay alive until B yielded.  After this patch B is entered by A's parent
so that a A can be deleted immediately if it is terminating.

It is safe to make this change since B could never interact with A if it
was terminating anyway.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20180322152834.12656-3-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-03-27 13:05:28 +01:00
..
acl.h
atomic.h
base64.h
bcd.h
bitmap.h
bitops.h
bswap.h fpu/softfloat-types: new header to prevent excessive re-builds 2018-02-21 10:20:19 +00:00
buffer.h
compiler.h compiler: Add QEMU_BUILD_BUG_MSG() macro 2018-03-19 10:00:14 -05:00
config-file.h
coroutine_int.h coroutine: avoid co_queue_wakeup recursion 2018-03-27 13:05:28 +01:00
coroutine.h
cpuid.h
crc32c.h
cutils.h cutils: add qemu_strtoi & qemu_strtoui parsers for int/unsigned int types 2018-03-13 18:06:05 +00:00
envlist.h
error-report.h
event_notifier.h
fifo8.h
fifo32.h
fprintf-fn.h
futex.h
hbitmap.h
help_option.h
host-utils.h
id.h
int128.h
iov.h
jhash.h
lockable.h lockable: workaround GCC link issue with ASAN 2018-03-06 14:01:27 +01:00
log-for-trace.h log-for-trace.h: Split out parts of log.h used by trace.h 2018-03-12 11:10:20 +00:00
log.h log-for-trace.h: Split out parts of log.h used by trace.h 2018-03-12 11:10:20 +00:00
main-loop.h
memfd.h
mmap-alloc.h
module.h audio: add module loading support 2018-03-12 11:18:26 +01:00
notify.h
option_int.h
option.h util: Add qemu_opts_to_qdict_filtered() 2018-03-09 15:17:47 +01:00
osdep.h mem: add share parameter to memory-backend-ram 2018-02-19 13:03:24 +02:00
path.h
processor.h
qdist.h
qht.h
queue.h queue: add QSIMPLEQ_PREPEND() 2018-03-27 13:05:28 +01:00
range.h
ratelimit.h ratelimit: don't align wait time with slices 2018-02-15 09:39:49 +00:00
rcu_queue.h
rcu.h membarrier: introduce qemu/sys_membarrier.h 2018-03-12 16:12:47 +01:00
readline.h
seqlock.h
sockets.h sockets: move fd_is_socket() into common sockets code 2018-03-13 18:06:06 +00:00
stats64.h
sys_membarrier.h membarrier: add --enable-membarrier 2018-03-12 16:12:47 +01:00
systemd.h
thread-posix.h
thread-win32.h
thread.h
throttle-options.h
throttle.h Include less of the generated modular QAPI headers 2018-03-02 13:45:50 -06:00
timed-average.h
timer.h replay: save prior value of the host clock 2018-03-12 16:12:50 +01:00
typedefs.h
unicode.h
uri.h
uuid.h
vfio-helpers.h
xattr.h