From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757249AbZHGI0Z (ORCPT ); Fri, 7 Aug 2009 04:26:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757084AbZHGI0Y (ORCPT ); Fri, 7 Aug 2009 04:26:24 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:33483 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757051AbZHGI0W (ORCPT ); Fri, 7 Aug 2009 04:26:22 -0400 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Date: Fri, 7 Aug 2009 17:24:25 +0900 From: KAMEZAWA Hiroyuki To: Balbir Singh Cc: KOSAKI Motohiro , Rik van Riel , Avi Kivity , Wu Fengguang , Andrea Arcangeli , "Dike, Jeffrey G" , "Yu, Wilfred" , "Kleen, Andi" , Hugh Dickins , Andrew Morton , Christoph Lameter , Mel Gorman , LKML , linux-mm Subject: Re: [RFC] respect the referenced bit of KVM guest pages? Message-Id: <20090807172425.8554da30.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <661de9470908070054l2fa99ac6w6cac2be63cd5d91f@mail.gmail.com> References: <4A7AC201.4010202@redhat.com> <4A7AD6EB.9090208@redhat.com> <20090807120857.5BE2.A69D9226@jp.fujitsu.com> <661de9470908070054l2fa99ac6w6cac2be63cd5d91f@mail.gmail.com> Organization: FUJITSU Co. LTD. X-Mailer: Sylpheed 2.5.0 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 7 Aug 2009 13:24:34 +0530 Balbir Singh wrote: > On Fri, Aug 7, 2009 at 8:41 AM, KOSAKI > Motohiro wrote: > > Current memcgroup logic also use recent_scan/recent_rotate statistics. > > Isn't it enought? > > I don't understand the context, I'll look at the problem when I am > back (I am away from work for the next few days). > Brief summary: (please point out if not correct) prepare a memcg with memory.limit_in_bytex=128MB Run kvm on it, and use apps, those working-set is near to 256MB (then, heavy swap) In this case, - Anon memory are swapped-out even while there are file caches. Especially, a page for stack which is frequently accessed can be easily swapped out, again and again. One of reasone is a recent change as: "a page mapped with VM_EXEC is not pageout even if no reference" Without memcg, a user can use Gigabytes of memory, above change is very welcomed. Then, current point is "how we can handle this case without bad effect". One possibility I wonder is this is a problem of configuration mistake. setting memory.memsw.limit_in_bytes to be proper value may change bahavior. But it seems just a workaround. Can't we find algorithmic/heuristic way to avoid too much swap-out ? I think memcg can check # of swap-ins, but now, we don't have a tag to see the sign of "recently swapped-out page is reused" case or executable file pages are too much. I wonder we can comapre # of pageouted file-caches v.s. # of swapout anon. and keeping "# of pageouted file-caches < # of swapout anon." (or use swappiness) This state can be checked by recalim_stat. (per memcg) Hmm? I'm sorry I'll be on a trip Aug/11-Aug/17 and response will be delayed. Thanks, -Kame