Re: [PATCH 04/31] mm, vmscan: begin reclaiming pages on a per-node basis
From: Mel Gorman
Date: Tue Jul 19 2016 - 10:25:43 EST
On Tue, Jul 19, 2016 at 05:30:31PM +0900, Joonsoo Kim wrote:
> On Mon, Jul 18, 2016 at 03:27:14PM +0100, Mel Gorman wrote:
> > On Mon, Jul 18, 2016 at 01:11:22PM +0100, Mel Gorman wrote:
> > > The all_unreclaimable logic is related to the number of pages scanned
> > > but currently pages skipped contributes to pages scanned. That is one
> > > possibility. The other is that if all pages scanned are skipped then the
> > > OOM killer can believe there is zero progress.
> > >
> > > Try this to start with;
> > >
> >
> > And if that fails, try this heavier handed version that will scan the full
> > LRU potentially to isolate at least a single page if it's available for
> > zone-constrained allocations. It's compile-tested only
>
> I tested both patches but they don't work for me. Notable difference
> is that all_unreclaimable is now "no".
>
Ok, that's good to know at least. It at least indicates that skips
accounted as scans are a contributory factor.
> Just attach the oops log from heavier version.
>
Apparently, isolating at least one page is not enough. Please try the
following. If it fails, please post the test script you're using. I can
simulate what you describe (mapped reads combined with lots of forks)
but no guarantee I'll get it exactly right. I think it's ok to not
account skips as scans because the skips are already accounted for.
diff --git a/mm/vmscan.c b/mm/vmscan.c
index a6f31617a08c..0dc443b52228 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);
@@ -1428,6 +1428,9 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
nr_skipped[page_zonenum(page)]++;
continue;
}
+`
+ /* Pages skipped do not contribute to scan */
+ scan++;
switch (__isolate_lru_page(page, mode)) {
case 0:
--
Mel Gorman
SUSE Labs