[PATCH][Fix] swsusp: take lowmem reserves into account
From: Rafael J. Wysocki
Date: Thu Apr 13 2006 - 15:17:24 EST
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 <rjw@xxxxxxx>
---
kernel/power/swsusp.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
Index: linux-2.6.17-rc1-mm2/kernel/power/swsusp.c
===================================================================
--- linux-2.6.17-rc1-mm2.orig/kernel/power/swsusp.c 2006-04-12 07:09:20.000000000 +0200
+++ linux-2.6.17-rc1-mm2/kernel/power/swsusp.c 2006-04-13 20:38:23.000000000 +0200
@@ -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)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/