From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Lieven Subject: Re: linux guests and ksm performance Date: Tue, 28 Feb 2012 14:20:20 +0100 Message-ID: <4F4CD494.5020909@dlh.net> References: <1333613dbb15f2b736394d77e795223e.squirrel@ssl.dlh.net> <2c2e4d6e-53f0-4698-8ad0-f4708b7987c6@email.android.com> <4F4CD3AF.7090709@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from ssl.dlh.net ([91.198.192.8]:53245 "EHLO ssl.dlh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932400Ab2B1NUW (ORCPT ); Tue, 28 Feb 2012 08:20:22 -0500 In-Reply-To: <4F4CD3AF.7090709@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 28.02.2012 14:16, Avi Kivity wrote: > On 02/24/2012 08:41 AM, Stefan Hajnoczi wrote: >>> I dont think that it is cpu intense. All user pages are zeroed anyway, but at allocation time it shouldnt be a big difference in terms of cpu power. >> It's easy to find a scenario where eagerly zeroing pages is wasteful. >> Imagine a process that uses all of physical memory. Once it >> terminates the system is going to run processes that only use a small >> set of pages. It's pointless zeroing all those pages if we're not >> going to use them anymore. > In the long term, we will use them, except if the guest is completely idle. > > The scenario in which zeroing is expensive is when the page is refilled > through DMA. In that case the zeroing was wasted. This is a pretty > common scenario in pagecache intensive workloads. > Avi, what do you think of the proposal to give the guest vm a hint that the host is running ksm? In that case the administrator has already chosen that saving physical memory is more important than performance to him? Peter From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2Mym-0005QA-HS for qemu-devel@nongnu.org; Tue, 28 Feb 2012 08:20:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2Myc-0007Ex-Il for qemu-devel@nongnu.org; Tue, 28 Feb 2012 08:20:32 -0500 Received: from ssl.dlh.net ([91.198.192.8]:33981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2Myc-0007Ek-Cq for qemu-devel@nongnu.org; Tue, 28 Feb 2012 08:20:22 -0500 Message-ID: <4F4CD494.5020909@dlh.net> Date: Tue, 28 Feb 2012 14:20:20 +0100 From: Peter Lieven MIME-Version: 1.0 References: <1333613dbb15f2b736394d77e795223e.squirrel@ssl.dlh.net> <2c2e4d6e-53f0-4698-8ad0-f4708b7987c6@email.android.com> <4F4CD3AF.7090709@redhat.com> In-Reply-To: <4F4CD3AF.7090709@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] linux guests and ksm performance List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, kvm@vger.kernel.org On 28.02.2012 14:16, Avi Kivity wrote: > On 02/24/2012 08:41 AM, Stefan Hajnoczi wrote: >>> I dont think that it is cpu intense. All user pages are zeroed anyway, but at allocation time it shouldnt be a big difference in terms of cpu power. >> It's easy to find a scenario where eagerly zeroing pages is wasteful. >> Imagine a process that uses all of physical memory. Once it >> terminates the system is going to run processes that only use a small >> set of pages. It's pointless zeroing all those pages if we're not >> going to use them anymore. > In the long term, we will use them, except if the guest is completely idle. > > The scenario in which zeroing is expensive is when the page is refilled > through DMA. In that case the zeroing was wasted. This is a pretty > common scenario in pagecache intensive workloads. > Avi, what do you think of the proposal to give the guest vm a hint that the host is running ksm? In that case the administrator has already chosen that saving physical memory is more important than performance to him? Peter