From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752777AbcGYIE3 (ORCPT ); Mon, 25 Jul 2016 04:04:29 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:56418 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752348AbcGYIEY (ORCPT ); Mon, 25 Jul 2016 04:04:24 -0400 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Mon, 25 Jul 2016 17:04:56 +0900 From: Minchan Kim To: Mel Gorman Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Vlastimil Babka , Linux-MM , LKML Subject: Re: [PATCH 1/5] mm, vmscan: Do not account skipped pages as scanned Message-ID: <20160725080456.GB1660@bbox> References: <1469028111-1622-1-git-send-email-mgorman@techsingularity.net> <1469028111-1622-2-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1469028111-1622-2-git-send-email-mgorman@techsingularity.net> 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 On Wed, Jul 20, 2016 at 04:21:47PM +0100, Mel Gorman wrote: > Page reclaim determines whether a pgdat is unreclaimable by examining how > many pages have been scanned since a page was freed and comparing that > to the LRU sizes. Skipped pages are not considered reclaim candidates but > contribute to scanned. This can prematurely mark a pgdat as unreclaimable > and trigger an OOM kill. > > While this does not fix an OOM kill message reported by Joonsoo Kim, > it did stop pgdat being marked unreclaimable. > > Signed-off-by: Mel Gorman > --- > mm/vmscan.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 22aec2bcfeec..b16d578ce556 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1415,7 +1415,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, > LIST_HEAD(pages_skipped); > > for (scan = 0; scan < nr_to_scan && nr_taken < nr_to_scan && > - !list_empty(src); scan++) { > + !list_empty(src);) { > struct page *page; > > page = lru_to_page(src); > @@ -1429,6 +1429,9 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, > continue; > } > > + /* Pages skipped do not contribute to scan */ > + scan++; > + As I mentioned in previous version, under irq-disabled-spin-lock, such unbounded operation would make the latency spike worse if there are lot of pages we should skip. Don't we take care it?