From: Mel Gorman Date: Fri, 8 Jul 2011 22:39:39 +0000 (-0700) Subject: mm: vmscan: evaluate the watermarks against the correct classzone X-Git-Tag: v2.6.39.4~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e04233dfb00de548700e29f59f733d0f616f3a2;p=thirdparty%2Fkernel%2Fstable.git mm: vmscan: evaluate the watermarks against the correct classzone commit da175d06b437093f93109ba9e5efbe44dfdf9409 upstream. 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 Reported-by: Pádraig Brady Tested-by: Pádraig Brady Tested-by: Andrew Lutomirski Acked-by: Rik van Riel Reviewed-by: Minchan Kim Cc: KOSAKI Motohiro Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 973efaa7d6dbc..b5cf90196ff89 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2279,7 +2279,7 @@ static bool sleeping_prematurely(pg_data_t *pgdat, int order, long remaining, } if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone), - classzone_idx, 0)) + i, 0)) all_zones_ok = false; else balanced += zone->present_pages;