From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFoFl-0005p3-Ez for qemu-devel@nongnu.org; Wed, 22 Jun 2016 15:56:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFoFh-0005VY-6D for qemu-devel@nongnu.org; Wed, 22 Jun 2016 15:56:00 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:60326 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFoFg-0005TC-T8 for qemu-devel@nongnu.org; Wed, 22 Jun 2016 15:55:57 -0400 Message-ID: <576AED47.4010504@kamp.de> Date: Wed, 22 Jun 2016 21:55:51 +0200 From: Peter Lieven MIME-Version: 1.0 References: <5768F923.7040502@kamp.de> <20160621131815.GB2264@work-vm> <57695979.2020102@kamp.de> <20160622105656.GC11330@stefanha-x1.localdomain> In-Reply-To: <20160622105656.GC11330@stefanha-x1.localdomain> Content-Type: text/plain; charset=windows-1252 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: Stefan Hajnoczi Cc: "Dr. David Alan Gilbert" , Paolo Bonzini , "qemu-devel@nongnu.org" Am 22.06.2016 um 12:56 schrieb Stefan Hajnoczi: > On Tue, Jun 21, 2016 at 05:12:57PM +0200, Peter Lieven wrote: >> - We changed the coroutine pool to a per thread model. I disabled the pool. This seems >> to cut the max used RSS to about 150MB which is still a lot more than qemu-2.2.0 > The per-thread coroutine pools only grow when a thread creates/destroys > coroutines. > > The QEMU main loop, iothread, and maybe vcpus should use coroutines. > The numerous thread-pool worker threads should not use coroutines IIRC. > > Creating coroutines is expensive and the pools improve performance a > lot. Maybe you can make observations about how to manage pool size more > efficiently for your VM? I did not want to blame the coroutine pool. Its a good thing. I just wanted to mention that we changed from a global pool (with a global mutex) to a thread based pool. This might influence memory consumption. But the increased RSS usage I observe is also there with disable coroutine pool. What makes the coroutine pool memory intensive is the stack size of 1MB per coroutine. Is it really necessary to have such a big stack? Peter