X-Spam-Checker-Version: SpamAssassin 3.4.0-r929098 (2010-03-30) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.4.0-r929098 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id p7B9PS3C239322 for ; Thu, 11 Aug 2011 04:25:28 -0500 X-ASG-Debug-ID: 1313054726-5c3200c50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from fgwmail5.fujitsu.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BF2FED202F for ; Thu, 11 Aug 2011 02:25:27 -0700 (PDT) Received: from fgwmail5.fujitsu.co.jp (fgwmail5.fujitsu.co.jp [192.51.44.35]) by cuda.sgi.com with ESMTP id AlED66N9xWFWFIvw for ; Thu, 11 Aug 2011 02:25:27 -0700 (PDT) Received: from m2.gw.fujitsu.co.jp (unknown [10.0.50.72]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 1325E3EE0C3 for ; Thu, 11 Aug 2011 18:25:26 +0900 (JST) Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id DBD2445DE89 for ; Thu, 11 Aug 2011 18:25:25 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id BC37145DE82 for ; Thu, 11 Aug 2011 18:25:25 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id AE0D4E08006 for ; Thu, 11 Aug 2011 18:25:25 +0900 (JST) Received: from m107.s.css.fujitsu.com (m107.s.css.fujitsu.com [10.240.81.147]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 6A3501DB8038 for ; Thu, 11 Aug 2011 18:25:25 +0900 (JST) Received: from m107.css.fujitsu.com (m107 [127.0.0.1]) by m107.s.css.fujitsu.com (Postfix) with ESMTP id 1CF3C860013; Thu, 11 Aug 2011 18:25:25 +0900 (JST) Received: from WIN-WAU6SZB64RR (unknown [10.124.101.94]) by m107.s.css.fujitsu.com (Postfix) with SMTP id 7411986000A; Thu, 11 Aug 2011 18:25:24 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from WIN-WAU6SZB64RR[10.124.101.94] by WIN-WAU6SZB64RR (FujitsuOutboundMailChecker v1.3.1/9992[10.124.101.94]); Thu, 11 Aug 2011 18:18:14 +0900 (JST) Date: Thu, 11 Aug 2011 18:18:04 +0900 From: KAMEZAWA Hiroyuki To: Mel Gorman Cc: Linux-MM , LKML , XFS , Dave Chinner , Christoph Hellwig , Johannes Weiner , Wu Fengguang , Jan Kara , Rik van Riel , Minchan Kim X-ASG-Orig-Subj: Re: [PATCH 6/7] mm: vmscan: Throttle reclaim if encountering too many dirty pages under writeback Subject: Re: [PATCH 6/7] mm: vmscan: Throttle reclaim if encountering too many dirty pages under writeback Message-Id: <20110811181804.44f2ee80.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <1312973240-32576-7-git-send-email-mgorman@suse.de> References: <1312973240-32576-1-git-send-email-mgorman@suse.de> <1312973240-32576-7-git-send-email-mgorman@suse.de> Organization: FUJITSU Co. LTD. X-Mailer: Sylpheed 3.1.1 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Barracuda-Connect: fgwmail5.fujitsu.co.jp[192.51.44.35] X-Barracuda-Start-Time: 1313054727 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.71442 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Status: Clean On Wed, 10 Aug 2011 11:47:19 +0100 Mel Gorman wrote: > Workloads that are allocating frequently and writing files place a > large number of dirty pages on the LRU. With use-once logic, it is > possible for them to reach the end of the LRU quickly requiring the > reclaimer to scan more to find clean pages. Ordinarily, processes that > are dirtying memory will get throttled by dirty balancing but this > is a global heuristic and does not take into account that LRUs are > maintained on a per-zone basis. This can lead to a situation whereby > reclaim is scanning heavily, skipping over a large number of pages > under writeback and recycling them around the LRU consuming CPU. > > This patch checks how many of the number of pages isolated from the > LRU were dirty and under writeback. If a percentage of them under > writeback, the process will be throttled if a backing device or the > zone is congested. Note that this applies whether it is anonymous or > file-backed pages that are under writeback meaning that swapping is > potentially throttled. This is intentional due to the fact if the > swap device is congested, scanning more pages and dispatching more > IO is not going to help matters. > > The percentage that must be in writeback depends on the priority. At > default priority, all of them must be dirty. At DEF_PRIORITY-1, 50% > of them must be, DEF_PRIORITY-2, 25% etc. i.e. as pressure increases > the greater the likelihood the process will get throttled to allow > the flusher threads to make some progress. > > Signed-off-by: Mel Gorman > Reviewed-by: Minchan Kim > Acked-by: Johannes Weiner Reviewed-by: KAMEZAWA Hiroyuki Maybe I need to add memcg_is_congested() ...