From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvn7y-000406-C5 for qemu-devel@nongnu.org; Tue, 02 Dec 2014 08:04:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xvn7s-00042j-7Y for qemu-devel@nongnu.org; Tue, 02 Dec 2014 08:04:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvn7s-00042f-0y for qemu-devel@nongnu.org; Tue, 02 Dec 2014 08:04:20 -0500 Date: Tue, 2 Dec 2014 14:04:05 +0100 From: Kevin Wolf Message-ID: <20141202130405.GI7283@noname.str.redhat.com> References: <1417518350-6167-1-git-send-email-pbonzini@redhat.com> <1417518350-6167-6-git-send-email-pbonzini@redhat.com> <547DABDE.2050009@kamp.de> <547DACF9.2090106@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <547DACF9.2090106@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 5/7] coroutine: rewrite pool to avoid mutex List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: ming.lei@canonical.com, Peter Lieven , qemu-devel@nongnu.org, stefanha@redhat.com Am 02.12.2014 um 13:13 hat Paolo Bonzini geschrieben: > > > On 02/12/2014 13:09, Peter Lieven wrote: > >> > >> -static void __attribute__((destructor)) coroutine_pool_cleanup(void) > >> -{ > >> - Coroutine *co; > >> - Coroutine *tmp; > >> - > >> - QSLIST_FOREACH_SAFE(co, &pool, pool_next, tmp) { > >> - QSLIST_REMOVE_HEAD(&pool, pool_next); > >> - qemu_coroutine_delete(co); > >> - } > >> - > >> - qemu_mutex_destroy(&pool_lock); > >> -} > >> - > > > > I still feel we should leave this destructor in to clean up the > > release_pool. > > Why? If you run QEMU under valgrind, there are thousands of blocks that > we do not free. Stefan/Kevin, what do you think? The destructor doesn't seem to be doing anything but freeing memory, which the OS can indeed do for us. I don't mind either way. Kevin