From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvmQ0-0001Oc-FO for qemu-devel@nongnu.org; Tue, 02 Dec 2014 07:19:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvmPr-0004ew-An for qemu-devel@nongnu.org; Tue, 02 Dec 2014 07:19:00 -0500 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:51060 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvmPr-0004eg-0n for qemu-devel@nongnu.org; Tue, 02 Dec 2014 07:18:51 -0500 Message-ID: <547DAE27.7050306@kamp.de> Date: Tue, 02 Dec 2014 13:18:47 +0100 From: Peter Lieven MIME-Version: 1.0 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> In-Reply-To: <547DACF9.2090106@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 , qemu-devel@nongnu.org Cc: kwolf@redhat.com, ming.lei@canonical.com, stefanha@redhat.com On 02.12.2014 13:13, Paolo Bonzini wrote: > > 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? Before this patch we cleaned up this part at least. I have learned that it bad style not to clean up your resources. Just because other code parts do not do it we should not introduce new parts that don't it. Peter