mm/vmscan.c: consider swap space when deciding whether to continue reclaim
authorMinchan Kim <minchan@kernel.org>
Tue, 10 Jan 2012 23:08:18 +0000 (15:08 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 2 Aug 2012 13:37:35 +0000 (14:37 +0100)
commitcef8678eb9832de6ac3f32810509393e28416d7e
treebd16cf00193f37de2340fd861b093831d73df64b
parent2addaa3c03214d7c5d256dd8a96cf3db83d7f737
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 <minchan@kernel.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
mm/vmscan.c