diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2006-06-23 02:04:46 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 07:42:59 -0700 |
commit | a938c356d5b007fe6d28251c0ddbf6c11d0d92b5 (patch) | |
tree | e55827ad27bf0a1b3a0cae821219a863c25173b7 | |
parent | 3e3318dee0878d42ed62a19c292a2ac284135db3 (diff) | |
download | op-kernel-dev-a938c356d5b007fe6d28251c0ddbf6c11d0d92b5.zip op-kernel-dev-a938c356d5b007fe6d28251c0ddbf6c11d0d92b5.tar.gz |
[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 <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | kernel/power/swsusp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 78b6e71..f0ee4e7 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) |