swsusp: take lowmem reserves into account
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- kernel/power/swsusp.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-)
kernel/power/swsusp.c +3 -1
@@ -192,8 +192,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_all_memory (SHRINK_BITE );if (!tmp)