From: Rafael J. Wysocki Date: Fri, 23 Jun 2006 09:04:46 +0000 (-0700) Subject: [PATCH] swsusp: take lowmem reserves into account X-Git-Tag: v2.6.18-rc1~1081^2~103 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a938c356d5b007fe6d28251c0ddbf6c11d0d92b5;p=linux-2.6 [PATCH] swsusp: take lowmem reserves into account swsusp allocates memory from the normal zone, so it cannot use lowmem reserve pages from the lower zones. Therefore it should not count these pages as available to it. Signed-off-by: Rafael J. Wysocki Cc: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 78b6e71b08..f0ee4e7780 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c @@ -188,8 +188,10 @@ int swsusp_shrink_memory(void) PAGES_FOR_IO; tmp = size; for_each_zone (zone) - if (!is_highmem(zone)) + if (!is_highmem(zone) && populated_zone(zone)) { tmp -= zone->free_pages; + tmp += zone->lowmem_reserve[ZONE_NORMAL]; + } if (tmp > 0) { tmp = __shrink_memory(tmp); if (!tmp)