From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKT22-0003BN-CJ for qemu-devel@nongnu.org; Thu, 12 May 2011 06:22:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKT21-00053p-Eq for qemu-devel@nongnu.org; Thu, 12 May 2011 06:22:10 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:60985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKT21-00053k-Ak for qemu-devel@nongnu.org; Thu, 12 May 2011 06:22:09 -0400 Received: by gyg4 with SMTP id 4so548272gyg.4 for ; Thu, 12 May 2011 03:22:08 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4DCBB2B2.6070307@redhat.com> References: <1305194086-9832-1-git-send-email-stefanha@linux.vnet.ibm.com> <1305194086-9832-5-git-send-email-stefanha@linux.vnet.ibm.com> <4DCBB2B2.6070307@redhat.com> Date: Thu, 12 May 2011 11:22:08 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 4/4] coroutine: pool coroutines to speed up creation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Paolo Bonzini , Anthony Liguori , Venkateswararao Jujjuri , Stefan Hajnoczi , qemu-devel@nongnu.org On Thu, May 12, 2011 at 11:13 AM, Kevin Wolf wrote: > terAm 12.05.2011 11:54, schrieb Stefan Hajnoczi: >> This patch speeds up coroutine creation by reusing freed coroutines. >> When a coroutine terminates it is placed in the pool instead of having >> its resources freed. =A0The next time a coroutine is created it can be >> taken straight from the pool and requires no initialization. >> >> Performance results on an Intel Core2 Duo T9400 (2.53GHz) for >> ./check-coroutine --benchmark-lifecycle 20000000: >> >> =A0 No pooling: =A0 =A019.5 sec >> =A0 With pooling: =A0 1.1 sec >> >> Signed-off-by: Stefan Hajnoczi >> --- >> =A0check-coroutine.c =A0 =A0| =A0 =A02 ++ >> =A0qemu-coroutine-int.h | =A0 =A02 ++ >> =A0qemu-coroutine.c =A0 =A0 | =A0 49 +++++++++++++++++++++++++++++++++++= +++++++++++--- >> =A0qemu-coroutine.h =A0 =A0 | =A0 =A09 +++++++++ >> =A0vl.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 ++ >> =A05 files changed, 61 insertions(+), 3 deletions(-) >> >> diff --git a/check-coroutine.c b/check-coroutine.c >> index 5a42c49..223c50c 100644 >> --- a/check-coroutine.c >> +++ b/check-coroutine.c >> @@ -218,6 +218,8 @@ int main(int argc, char **argv) >> =A0 =A0 =A0}; >> =A0 =A0 =A0int i; >> >> + =A0 =A0qemu_coroutine_init(); > > Can we use module_init instead of adding an explicit call to main()? > This would prevent forgetting to add it in qemu-img and qemu-io like in > this patch. module_init what? :) qemu-img/qemu-io only init MODULE_INIT_BLOCK so we'd have to modify them anyway. I don't want to add qemu-img/qemu-io things yet because we don't have a block layer user for coroutines yet. The qcow2 patches should contain these changes. Stefan