mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][Fix] swsusp: take lowmem reserves into account
@ 2006-04-13 19:15 Rafael J. Wysocki
  0 siblings, 0 replies; only message in thread
From: Rafael J. Wysocki @ 2006-04-13 19:15 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Pavel Machek

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@sisk.pl>
---
 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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-13 19:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-13 19:15 [PATCH][Fix] swsusp: take lowmem reserves into account Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®