From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fagiQ-0008QD-S7 for qemu-devel@nongnu.org; Wed, 04 Jul 2018 08:16:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fagiM-0002DP-Jk for qemu-devel@nongnu.org; Wed, 04 Jul 2018 08:16:58 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56334 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fagiM-0002DE-Dy for qemu-devel@nongnu.org; Wed, 04 Jul 2018 08:16:54 -0400 References: <20180701171953.9921-1-clg@kaod.org> <20180702035726.GK2455@xz-mi> <20180704022648.GA2568@xz-mi> <95fe81b1-13ee-5c82-22e2-e5ef4abd1168@redhat.com> <20180704095520.GD2568@xz-mi> From: Paolo Bonzini Message-ID: <9e9c51da-f7aa-c3d1-0beb-4dbfaf31a592@redhat.com> Date: Wed, 4 Jul 2018 14:16:42 +0200 MIME-Version: 1.0 In-Reply-To: <20180704095520.GD2568@xz-mi> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] exec.c: check RAMBlock validity before changing its flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , qemu-devel@nongnu.org, "Dr . David Alan Gilbert" , Peter Maydell , "Michael S. Tsirkin" , Alex Williamson , David Gibson On 04/07/2018 11:55, Peter Xu wrote: >> commit b0e56e0b63f350691b52d3e75e89bb64143fbeff >> Author: Hu Tao >> Date: Wed Apr 2 15:13:27 2014 +0800 >> >> unset RAMBlock idstr when unregister MemoryRegion >> >> Signed-off-by: Hu Tao >> Signed-off-by: Paolo Bonzini >> >> whose commit message is a bit lacking, but >> http://lists.gnu.org/archive/html/qemu-devel/2014-04/msg00282.html helps >> more. It seems like the original bug was a reference count issue. >> >> Clearing the new migratable flag should also be unnecessary. > But even if we get rid of vmstate_unregister_ram(), the leak could > still be there? > > I'm not sure what was leaked when b0e56e0b6 was introduced, I feel > like it's the RAMBlock of the memdev. Here I think the ROM memory > region seems to be leaked as well (along with the RAMBlock inside)? The leak would be another bug that vmstate_unregister_ram is just papering over. We need to test memory unplug with vmstate_unregister_ram removed, and fix bugs if any. Paolo