Received: from eggs.gnu.org ([2001:4830:134:3::10]:34485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X30qv-0004nG-Le for qemu-devel@nongnu.org; Fri, 04 Jul 2014 06:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X30qn-0000DA-E8 for qemu-devel@nongnu.org; Fri, 04 Jul 2014 06:36:25 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:40363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X30qn-0000Cd-3r for qemu-devel@nongnu.org; Fri, 04 Jul 2014 06:36:17 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <1404464167-5188-1-git-send-email-stefanha@redhat.com> <1404464167-5188-3-git-send-email-stefanha@redhat.com> Date: Fri, 04 Jul 2014 12:36:13 +0200 In-Reply-To: <1404464167-5188-3-git-send-email-stefanha@redhat.com> (Stefan Hajnoczi's message of "Fri, 4 Jul 2014 10:56:07 +0200") Message-ID: <87wqbtpg0y.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 2/2] block: bump coroutine pool size for drives List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Paolo Bonzini , ming.lei@canonical.com, qemu-devel@nongnu.org Stefan Hajnoczi writes: > When a BlockDriverState is associated with a storage controller > DeviceState we expect guest I/O. Use this opportunity to bump the > coroutine pool size by 64. > This patch ensures that the coroutine pool size scales with the number > of drives attached to the guest. It should increase coroutine pool > usage (which makes qemu_coroutine_create() fast) without hogging too > much memory when fewer drives are attached. > Signed-off-by: Stefan Hajnoczi > --- > block.c | 4 ++++ > 1 file changed, 4 insertions(+) > diff --git a/block.c b/block.c > index f80e2b2..c8379ca 100644 > --- a/block.c > +++ b/block.c > @@ -2093,6 +2093,9 @@ int bdrv_attach_dev(BlockDriverState *bs, void *dev) > } bs-> dev = dev; > bdrv_iostatus_reset(bs); > + > + /* We're expecting I/O from the device so bump up coroutine pool size */ > + qemu_coroutine_adjust_pool_size(64); > return 0; > } > @@ -2112,6 +2115,7 @@ void bdrv_detach_dev(BlockDriverState *bs, void *dev) bs-> dev_ops = NULL; bs-> dev_opaque = NULL; bs-> guest_block_size = 512; > + qemu_coroutine_adjust_pool_size(-64); > } > /* TODO change to return DeviceState * when all users are qdevified */ Small nitpick. Wouldn't it be better to refactor that constant to a define/enum (like in POOL_DEFAULT_SIZE)? Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth