From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuKrG-0000pH-LT for qemu-devel@nongnu.org; Fri, 28 Nov 2014 07:41:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuKr7-0005jh-GH for qemu-devel@nongnu.org; Fri, 28 Nov 2014 07:41:10 -0500 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:33430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuKr7-0005jX-8G for qemu-devel@nongnu.org; Fri, 28 Nov 2014 07:41:01 -0500 Received: by mail-wi0-f179.google.com with SMTP id ex7so11127211wid.0 for ; Fri, 28 Nov 2014 04:41:00 -0800 (PST) Date: Fri, 28 Nov 2014 12:40:57 +0000 From: Stefan Hajnoczi Message-ID: <20141128124057.GH13631@stefanha-thinkpad.redhat.com> References: <1417084026-12307-1-git-send-email-pl@kamp.de> <1417084026-12307-4-git-send-email-pl@kamp.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X+8siUETKMkW99st" Content-Disposition: inline In-Reply-To: <1417084026-12307-4-git-send-email-pl@kamp.de> Subject: Re: [Qemu-devel] [RFC PATCH 3/3] qemu-coroutine: use a ring per thread for the pool List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, famz@redhat.com, benoit@irqsave.net, ming.lei@canonical.com, armbru@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, mreitz@redhat.com --X+8siUETKMkW99st Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 27, 2014 at 11:27:06AM +0100, Peter Lieven wrote: > diff --git a/iothread.c b/iothread.c > index 342a23f..b53529b 100644 > --- a/iothread.c > +++ b/iothread.c > @@ -15,6 +15,7 @@ > #include "qom/object_interfaces.h" > #include "qemu/module.h" > #include "block/aio.h" > +#include "block/coroutine.h" > #include "sysemu/iothread.h" > #include "qmp-commands.h" > #include "qemu/error-report.h" > @@ -47,6 +48,8 @@ static void *iothread_run(void *opaque) > } > aio_context_release(iothread->ctx); > } > + > + coroutine_pool_cleanup(); > return NULL; > } The assumption here is that iothread_run() is the only thread function that uses coroutines. If another thread uses coroutines the pool will leak :(. This is one of the challenges of thread-local storage. --X+8siUETKMkW99st Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUeG1ZAAoJEJykq7OBq3PI5F8IAMlJOF9nxlTpj8QhnFDrMVwG +5m8EtC8prAqS00S2A73J+xNif2t0Pxry9rMxn8mSkFJ1IwLhvD+b+eLrPb8ll6e 1BWafdEnQ0iJ1myHuHS6jdiZxi0Z1LweJ51lAO9XKUXD7/hiYB7HFaka6eXDD9PN JTOXC4u2ExNMdOIOfADkwVX26/9m1LlYEFY5ZQUljWzhh3ZPq94tzsOlq/YyvmGc Nro/lGUS26VeqGJVFyZ9l642cr/JDFFCxRbtxavHY6xdldtNjVC90o9YCTdlln0e Iu4ekrF0CTUkJW2L8emVKYOE3L69D4WrEMYQ+dO4MkPHVgrDNNirwUOOeGgbYAI= =L3oM -----END PGP SIGNATURE----- --X+8siUETKMkW99st--