From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG7MA-0000vj-9t for qemu-devel@nongnu.org; Thu, 23 Jun 2016 12:19:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG7M5-0006Qc-8v for qemu-devel@nongnu.org; Thu, 23 Jun 2016 12:19:53 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:38012 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG7M4-0006QI-Uv for qemu-devel@nongnu.org; Thu, 23 Jun 2016 12:19:49 -0400 References: <5768F923.7040502@kamp.de> <20160621131815.GB2264@work-vm> <576BF910.70304@kamp.de> <178ee05d-cb23-e1ba-5a7f-87a5caef1e91@redhat.com> <576C00D1.9020202@kamp.de> <48f0c4a6-8c26-446d-1dfd-c79da0c18707@redhat.com> From: Peter Lieven Message-ID: <576C0C1D.9090709@kamp.de> Date: Thu, 23 Jun 2016 18:19:41 +0200 MIME-Version: 1.0 In-Reply-To: <48f0c4a6-8c26-446d-1dfd-c79da0c18707@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Qemu and heavily increased RSS usage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , "Dr. David Alan Gilbert" Cc: "qemu-devel@nongnu.org" , Fam Zheng , Peter Maydell Am 23.06.2016 um 17:47 schrieb Paolo Bonzini: > > On 23/06/2016 17:31, Peter Lieven wrote: >> Am 23.06.2016 um 17:21 schrieb Paolo Bonzini: >>> On 23/06/2016 16:58, Peter Lieven wrote: >>>> commit ba3f4f64b0e941b9e03568b826746941bef071f9 >>>> Author: Paolo Bonzini >>>> Date: Wed Jan 21 12:09:14 2015 +0100 >>>> >>>> exec: RCUify AddressSpaceDispatch >>>> >>>> Note that even after this patch, most callers of address_space_* >>>> functions must still be under the big QEMU lock, otherwise the >>>> memory >>>> region returned by address_space_translate can disappear as soon as >>>> address_space_translate returns. This will be fixed in the next >>>> part >>>> of this series. >>>> >>>> Reviewed-by: Fam Zheng >>>> Signed-off-by: Paolo Bonzini >>>> >>>> @Paolo, @Fam, any idea? >>> When you use RCU, freeing stuff is delayed a bit. >> define a bit? >> >> I face the issue that it seems (some) stuff is actually never freed... > Can you confirm that with e.g. valgrind? It could be that malloc has > asked the kernel for more RSS and never released that, but QEMU did free > the memory. Valgrind does not see the increased RSS. HEAD at 9d82b5a (gdb) monitor leak_check summary any ==10988== LEAK SUMMARY: ==10988== definitely lost: 392 bytes in 15 blocks ==10988== indirectly lost: 3,824 bytes in 38 blocks ==10988== possibly lost: 640 bytes in 2 blocks ==10988== still reachable: 3,510,751 bytes in 8,898 blocks ==10988== suppressed: 0 bytes in 0 blocks HEAD at 79e2b9a (gdb) monitor leak_check summary any ==8108== LEAK SUMMARY: ==8108== definitely lost: 392 bytes in 15 blocks ==8108== indirectly lost: 3,824 bytes in 38 blocks ==8108== possibly lost: 640 bytes in 2 blocks ==8108== still reachable: 3,510,975 bytes in 8,898 blocks ==8108== suppressed: 0 bytes in 0 blocks Mhh, so your idea could be right. But what to do now? The introduction of RCU obviously increases the short term RSS usage. But thats never corrected as it seems. I see this behaviour with kernel 3.19 and kernel 4.4 Peter