From: Hugh Dickins Date: Tue, 10 Jan 2012 23:08:33 +0000 (-0800) Subject: mm: test PageSwapBacked in lumpy reclaim X-Git-Tag: v2.6.39-400.9.0~302^2~30 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=993d208d4e7f3fb65c5bcb8bcf94193158ade99e;p=users%2Fjedix%2Flinux-maple.git 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 Reviewed-by: KOSAKI Motohiro Reviewed-by: Minchan Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Mel Gorman (cherry picked from commit d2b02236b85226c9f2cd28e32a9fdf197584e448) Signed-off-by: Jerry Snitselaar --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 24e6de110b23f..9c3f28b8484c5 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1199,7 +1199,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, * anon page which don't already have a swap slot is * pointless. */ - if (nr_swap_pages <= 0 && PageAnon(cursor_page) && + if (nr_swap_pages <= 0 && PageSwapBacked(cursor_page) && !PageSwapCache(cursor_page)) break;