qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [External] Re: [PATCH v3 2/2] coroutine: take exactly one batch from


From: 王洪浩
Subject: Re: [External] Re: [PATCH v3 2/2] coroutine: take exactly one batch from global pool at a time
Date: Thu, 11 Mar 2021 11:27:06 +0800

Will do, thanks!

Stefan Hajnoczi <stefanha@redhat.com> 于2021年3月8日周一 下午6:27写道:
>
> On Fri, Oct 16, 2020 at 07:26:40PM +0800, wanghonghao wrote:
> > This patch replace the global coroutine queue with a lock-free stack of 
> > which
> > the elements are coroutine queues. Threads can put coroutine queues into the
> > stack or take queues from it and each coroutine queue has exactly
> > POOL_BATCH_SIZE coroutines. Note that the stack is not strictly LIFO, but 
> > it's
> > enough for buffer pool.
> >
> > Coroutines will be put into thread-local pools first while release. Now the
> > fast pathes of both allocation and release are atomic-free, and there won't
> > be too many coroutines remain in a single thread since POOL_BATCH_SIZE has 
> > been
> > reduced to 16.
> >
> > In practice, I've run a VM with two block devices binding to two different
> > iothreads, and run fio with iodepth 128 on each device. It maintains around
> > 400 coroutines and has about 1% chance of calling to `qemu_coroutine_new`
> > without this patch. And with this patch, it maintains no more than 273
> > coroutines and doesn't call `qemu_coroutine_new` after initial allocations.
> >
> > Signed-off-by: wanghonghao <wanghonghao@bytedance.com>
> > ---
> >  util/qemu-coroutine.c | 63 ++++++++++++++++++++++++++++---------------
> >  1 file changed, 42 insertions(+), 21 deletions(-)
>
> Hi,
> I noticed this patch received no reviews. If you would still like to get
> it merged, please rebase to qemu.git/master and resend the patch series.
>
> Feel free to reply to your patches to remind maintainers if they have
> not reviewed it after a few days.
>
> Thanks,
> Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]