From: Takuya Yoshikawa Subject: Re: [PATCH] kvm: don't call mmu_shrinker w/o used_mmu_pages Date: Sat, 21 Apr 2012 11:29:32 +0900 Message-ID: <20120421112932.3e4bd031d1defc8fe7915ade@gmail.com> References: <1334356721-9009-1-git-send-email-yinghan@google.com> <20120420151143.433c514e.akpm@linux-foundation.org> <4F91E8CC.5080409@redhat.com> <20120421105615.6b0b03640f7553060628d840@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Ying Han , Rik van Riel , Andrew Morton , Michal Hocko , Johannes Weiner , Mel Gorman , KAMEZAWA Hiroyuki , Hillf Danton , Hugh Dickins , Dan Magenheimer , linux-mm@kvack.org, kvm@vger.kernel.org, Avi Kivity , Marcelo Tosatti , Eric Northup To: Mike Waychison Return-path: Received: from mail-pz0-f52.google.com ([209.85.210.52]:48739 "EHLO mail-pz0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752590Ab2DUC3i (ORCPT ); Fri, 20 Apr 2012 22:29:38 -0400 Received: by dake40 with SMTP id e40so13691144dak.11 for ; Fri, 20 Apr 2012 19:29:38 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 20 Apr 2012 19:15:24 -0700 Mike Waychison wrote: > In our situation, we simple disable the shrinker altogether. My > understanding is that we EPT or NPT, the amount of memory used by > these tables is bounded by the size of guest physical memory, whereas > with software shadowed tables, it is bounded by the addresses spaces > in the guest. This bound makes it reasonable to not do any reclaim > and charge it as a "system overhead tax". IIRC, KVM's mmu_shrink is mainly for protecting the host from pathological guest without EPT or NPT. You can see Avi's summary: -- http://www.spinics.net/lists/kvm/msg65671.html === We should aim for the following: - normal operation causes very little shrinks (some are okay) - high pressure mostly due to kvm results in kvm being shrunk (this is a pathological case caused by a starting a guest with a huge amount of memory, and mapping it all to /dev/zero (or ksm), and getting the guest the create shadow mappings for all of it) - general high pressure is shared among other caches like dcache and icache The cost of reestablishing an mmu page can be as high as half a millisecond of cpu time, which is the reason I want to be conservative. === Thanks, Takuya