summary refs log tree commit diff stats
path: root/qemu-io.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2013-09-11 16:42:35 +0200
committerKevin Wolf <kwolf@redhat.com>2013-09-12 10:12:48 +0200
commit70c60c089fdc6bf8a79324e492c13e8c08d55942 (patch)
tree03f26370db88432b5808f3a6a5c3c4bce229eaf5 /qemu-io.c
parent2c78857bf6a9b5d06e17533b8f40fee14e087987 (diff)
downloadfocaccia-qemu-70c60c089fdc6bf8a79324e492c13e8c08d55942.tar.gz
focaccia-qemu-70c60c089fdc6bf8a79324e492c13e8c08d55942.zip
coroutine: add ./configure --disable-coroutine-pool
The 'gthread' coroutine backend was written before the freelist (aka
pool) existed in qemu-coroutine.c.

This means that every thread is expected to exit when its coroutine
terminates.  It is not possible to reuse threads from a pool.

This patch automatically disables the pool when 'gthread' is used.  This
allows the 'gthread' backend to work again (for example,
tests/test-coroutine completes successfully instead of hanging).

I considered implementing thread reuse but I don't want quirks like CPU
affinity differences due to coroutine threads being recycled.  The
'gthread' backend is a reference backend and it's therefore okay to skip
the pool optimization.

Note this patch also makes it easy to toggle the pool for benchmarking
purposes:

  ./configure --with-coroutine-backend=ucontext \
              --disable-coroutine-pool

Reported-by: Gabriel Kerneis <gabriel@kerneis.info>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Gabriel Kerneis <gabriel@kerneis.info>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-io.c')
0 files changed, 0 insertions, 0 deletions