mm: test PageSwapBacked in lumpy reclaim
commit 043bcbe5ec51e0478ef2b44acef17193e01d7f70 upstream.
Stable note: Not tracked in Bugzilla. There were reports of shared
mapped pages being unfairly reclaimed in comparison to older kernels.
This is being addressed over time. Even though the subject
refers to lumpy reclaim, it impacts compaction as well.
Lumpy reclaim does well to stop at a PageAnon when there's no swap, but
better is to stop at any PageSwapBacked, which includes shmem/tmpfs too.
Signed-off-by: Hugh Dickins <firstname.lastname@example.org>
Reviewed-by: KOSAKI Motohiro <email@example.com>
Reviewed-by: Minchan Kim <firstname.lastname@example.org>
Signed-off-by: Andrew Morton <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
Signed-off-by: Mel Gorman <email@example.com>
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 504fd31..d24f690 100644
@@ -1199,7 +1199,7 @@
* anon page which don't already have a swap slot is
- if (nr_swap_pages <= 0 && PageAnon(cursor_page) &&
+ if (nr_swap_pages <= 0 && PageSwapBacked(cursor_page) &&