Skip to content
Commit ba20326a authored by Stefan Hajnoczi's avatar Stefan Hajnoczi Committed by Michael Roth
Browse files

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: default avatarGabriel Kerneis <gabriel@kerneis.info>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: default avatarGabriel Kerneis <gabriel@kerneis.info>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
(cherry picked from commit 70c60c08)

Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent ae00a27f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment