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: firefly_0821_release~35458^2~103 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a938c356d5b007fe6d28251c0ddbf6c11d0d92b5;p=firefly-linux-kernel-4.4.55.git [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 78b6e71b0813..f0ee4e7780d6 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)