[PATCH 1/2][Fix][mm] swsusp: fix counting of highmem pages

From: Rafael J. Wysocki
Date: Sun Dec 04 2005 - 18:00:27 EST


This patch fixes a problem with swsusp that causes suspend to
fail on systems with the highmem zone, if many highmem pages are in use.

The patch makes swsusp count the non-free highmem pages in a correct way
and, consequently, release a sufficient amount of memory before suspend.

Signed-off-by: Rafael J. Wysocki <rjw@xxxxxxx>

kernel/power/swsusp.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.15-rc3-mm1/kernel/power/swsusp.c
===================================================================
--- linux-2.6.15-rc3-mm1.orig/kernel/power/swsusp.c 2005-12-04 14:24:10.000000000 +0100
+++ linux-2.6.15-rc3-mm1/kernel/power/swsusp.c 2005-12-04 14:42:08.000000000 +0100
@@ -635,7 +635,8 @@
printk("Shrinking memory... ");
do {
#ifdef FAST_FREE
- tmp = count_data_pages() + count_highmem_pages();
+ tmp = 2 * count_highmem_pages();
+ tmp += tmp / 50 + count_data_pages();
tmp += (tmp + PBES_PER_PAGE - 1) / PBES_PER_PAGE +
PAGES_FOR_IO;
for_each_zone (zone)

-
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/