]> git.proxmox.com Git - qemu.git/commit
coroutine: add ./configure --disable-coroutine-pool
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 11 Sep 2013 14:42:35 +0000 (16:42 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 1 Oct 2013 03:57:15 +0000 (22:57 -0500)
commitba20326a937421c50a775907dc9ac726bb9a9b50
treeaf096886160d4df52a8c05a791f740009b5d6240
parentae00a27feab0ca12d2a802cfae9ee65ba3d43602
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>
(cherry picked from commit 70c60c089fdc6bf8a79324e492c13e8c08d55942)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
configure
qemu-coroutine.c