Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934548Ab3DKJJQ (ORCPT ); Thu, 11 Apr 2013 05:09:16 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38376 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765448Ab3DKJJO (ORCPT ); Thu, 11 Apr 2013 05:09:14 -0400 Date: Thu, 11 Apr 2013 10:09:09 +0100 From: Mel Gorman To: Kamezawa Hiroyuki Cc: Andrew Morton , Jiri Slaby , Valdis Kletnieks , Rik van Riel , Zlatko Calusic , Johannes Weiner , dormando , Satoru Moriya , Michal Hocko , Linux-MM , LKML Subject: Re: [PATCH 02/10] mm: vmscan: Obey proportional scanning requirements for kswapd Message-ID: <20130411090909.GF3710@suse.de> References: <1365505625-9460-1-git-send-email-mgorman@suse.de> <1365505625-9460-3-git-send-email-mgorman@suse.de> <516511DF.5020805@jp.fujitsu.com> <20130410140824.GC3710@suse.de> <5166005B.3060607@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <5166005B.3060607@jp.fujitsu.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1578 Lines: 52 On Thu, Apr 11, 2013 at 09:14:19AM +0900, Kamezawa Hiroyuki wrote: > > > >nr[lru] at the end there is pages remaining to be scanned not pages > >scanned already. > > yes. > > >Did you mean something like this? > > > >nr[lru] = scantarget[lru] * percentage / 100 - (scantarget[lru] - nr[lru]) > > > > For clarification, this "percentage" means the ratio of remaining scan target of > another LRU. So, *scanned* percentage is "100 - percentage", right ? > Yes, correct. > If I understand the changelog correctly, you'd like to keep > > scantarget[anon] : scantarget[file] > == really_scanned_num[anon] : really_scanned_num[file] > Yes. > even if we stop scanning in the middle of scantarget. And you introduced "percentage" > to make sure that both scantarget should be done in the same ratio. > Yes. > So...another lru should scan scantarget[x] * (100 - percentage)/100 in total. > > nr[lru] = scantarget[lru] * (100 - percentage)/100 - (scantarget[lru] - nr[lru]) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ > proportionally adjusted scan target already scanned num > > = nr[lru] - scantarget[lru] * percentage/100. > Yes, you are completely correct. This preserves the original ratio of anon:file scanning properly. -- Mel Gorman SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/