qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: wanghonghao <wanghonghao@bytedance.com>
Cc: kwolf@redhat.com, pbonzini@redhat.com, fam@euphon.net,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v3 2/2] coroutine: take exactly one batch from global pool at a time
Date: Mon, 8 Mar 2021 10:27:42 +0000	[thread overview]
Message-ID: <YEX8HlJXUgfPYlQk@stefanha-x1.localdomain> (raw)
In-Reply-To: <20201016112640.91141-2-wanghonghao@bytedance.com>

[-- Attachment #1: Type: text/plain, Size: 1535 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-03-08 10:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16 11:26 [PATCH v3 1/2] QSLIST: add atomic replace operation wanghonghao
2020-10-16 11:26 ` [PATCH v3 2/2] coroutine: take exactly one batch from global pool at a time wanghonghao
2021-03-08 10:27   ` Stefan Hajnoczi [this message]
2021-03-11  3:27     ` [External] " 王洪浩

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YEX8HlJXUgfPYlQk@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wanghonghao@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).