mm/vmscan.c: consider swap space when deciding whether to continue reclaim
commit 86cfd3a45042ab242d47f3935a02811a402beab6 upstream.
Stable note: Not tracked in Bugzilla. This patch reduces kswapd CPU
usage on swapless systems with high anonymous memory usage.
It's pointless to continue reclaiming when we have no swap space and lots
of anon pages in the inactive list.
Without this patch, it is possible when swap is disabled to continue
trying to reclaim when there are only anonymous pages in the system even
though that will not make any progress.
Signed-off-by: Minchan Kim <firstname.lastname@example.org>
Cc: KOSAKI Motohiro <email@example.com>
Acked-by: Mel Gorman <firstname.lastname@example.org>
Reviewed-by: Rik van Riel <email@example.com>
Cc: Johannes Weiner <firstname.lastname@example.org>
Cc: Andrea Arcangeli <email@example.com>
Signed-off-by: Andrew Morton <firstname.lastname@example.org>
Signed-off-by: Linus Torvalds <email@example.com>
Signed-off-by: Mel Gorman <firstname.lastname@example.org>
Signed-off-by: Greg Kroah-Hartman <email@example.com>
1 file changed