mm: vmscan: evaluate the watermarks against the correct classzone
authorMel Gorman <mgorman@suse.de>
Fri, 8 Jul 2011 22:39:39 +0000 (15:39 -0700)
committerSteve Conklin <sconklin@canonical.com>
Fri, 15 Jul 2011 17:21:16 +0000 (12:21 -0500)
commit741cc00dffa310ba6496065a284ea06386bf75bc
treedeb965948712a5297f61914357a86589224ec90f
parente1d7f3af3fe34348685086ddf85910d801ee7c38
mm: vmscan: evaluate the watermarks against the correct classzone

BugLink: http://bugs.launchpad.net/bugs/808509

When deciding if kswapd is sleeping prematurely, the classzone is taken
into account but this is different to what balance_pgdat() and the
allocator are doing.  Specifically, the DMA zone will be checked based on
the classzone used when waking kswapd which could be for a GFP_KERNEL or
GFP_HIGHMEM request.  The lowmem reserve limit kicks in, the watermark is
not met and kswapd thinks it's sleeping prematurely keeping kswapd awake in
error.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Reported-by: Pádraig Brady <P@draigBrady.com>
Tested-by: Pádraig Brady <P@draigBrady.com>
Tested-by: Andrew Lutomirski <luto@mit.edu>
Acked-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit da175d06b437093f93109ba9e5efbe44dfdf9409)
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
mm/vmscan.c