[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [Qemu-devel] [PATCH] coroutine: add ./configure --disa
From: |
Stefan Weil |
Subject: |
Re: [Qemu-stable] [Qemu-devel] [PATCH] coroutine: add ./configure --disable-coroutine-pool |
Date: |
Fri, 27 Sep 2013 07:20:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
Am 11.09.2013 16:42, schrieb Stefan Hajnoczi:
> 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 <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> configure | 24 ++++++++++++++++++++++++
> qemu-coroutine.c | 34 +++++++++++++++++++---------------
> 2 files changed, 43 insertions(+), 15 deletions(-)
>
This patch is important for QEMU 1.5 as well, but needs some
modifications there.
A recent bug report for MinGW shows that the win32 coroutine needs it, too.
Stefan, could you please prepare a patch for stable-1.5?
Regards
Stefan W.
- Re: [Qemu-stable] [Qemu-devel] [PATCH] coroutine: add ./configure --disable-coroutine-pool,
Stefan Weil <=