Skip to contentSkip to conversation

Patch "vmscan: fix increasing nr_isolated incurred by putback unevictable pages" has been added to the 4.2-stable tree

PATCH [email protected] 1 participant 1 message Sep 26, 2015

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

vmscan: fix increasing nr_isolated incurred by putback unevictable pages

to the 4.2-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
vmscan-fix-increasing-nr_isolated-incurred-by-putback-unevictable-pages.patch
and it can be found in the queue-4.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From c54839a722a02818677bcabe57e957f0ce4f841d Mon Sep 17 00:00:00 2001

From: Jaewon Kim <[email protected]>
Date: Tue, 8 Sep 2015 15:02:21 -0700
Subject: vmscan: fix increasing nr_isolated incurred by putback unevictable pages

From: Jaewon Kim <[email protected]>

commit c54839a722a02818677bcabe57e957f0ce4f841d upstream.

reclaim_clean_pages_from_list() assumes that shrink_page_list() returns number of pages removed from the candidate list. But shrink_page_list() puts back mlocked pages without passing it to caller and without counting as nr_reclaimed. This increases nr_isolated.

To fix this, this patch changes shrink_page_list() to pass unevictable pages back to caller. Caller will take care those pages.

Minchan said:

It fixes two issues.

1. With unevictable page, cma_alloc will be successful.

Exactly speaking, cma_alloc of current kernel will fail due to unevictable pages.

2. fix leaking of NR_ISOLATED counter of vmstat

With it, too_many_isolated works. Otherwise, it could make hang until the process get SIGKILL.

---
 mm/vmscan.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmscan.c +1 -1
@@ -1190,7 +1190,7 @@ cull_mlocked:
 		if (PageSwapCache(page))
 			try_to_free_swap(page);
 		unlock_page(page);
-		putback_lru_page(page);
+		list_add(&page->lru, &ret_pages);
 		continue;
 
 activate_locked:

Patches currently in stable-queue which might be from [email protected] are

queue-4.2/vmscan-fix-increasing-nr_isolated-incurred-by-putback-unevictable-pages.patch