summaryrefslogtreecommitdiffstats
path: root/kernel/power/swsusp.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2006-06-23 11:04:46 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 16:42:59 +0200
commita938c356d5b007fe6d28251c0ddbf6c11d0d92b5 (patch)
treee55827ad27bf0a1b3a0cae821219a863c25173b7 /kernel/power/swsusp.c
parent[PATCH] swsusp: x86_64 mark special saveable/unsaveable pages (diff)
downloadlinux-a938c356d5b007fe6d28251c0ddbf6c11d0d92b5.tar.xz
linux-a938c356d5b007fe6d28251c0ddbf6c11d0d92b5.zip
[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>
Diffstat (limited to 'kernel/power/swsusp.c')
-rw-r--r--kernel/power/swsusp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index 78b6e71b0813..f0ee4e7780d6 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)