aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/swsusp.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2006-06-23 05:04:46 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 10:42:59 -0400
commita938c356d5b007fe6d28251c0ddbf6c11d0d92b5 (patch)
treee55827ad27bf0a1b3a0cae821219a863c25173b7 /kernel/power/swsusp.c
parent3e3318dee0878d42ed62a19c292a2ac284135db3 (diff)
[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)
188 PAGES_FOR_IO; 188 PAGES_FOR_IO;
189 tmp = size; 189 tmp = size;
190 for_each_zone (zone) 190 for_each_zone (zone)
191 if (!is_highmem(zone)) 191 if (!is_highmem(zone) && populated_zone(zone)) {
192 tmp -= zone->free_pages; 192 tmp -= zone->free_pages;
193 tmp += zone->lowmem_reserve[ZONE_NORMAL];
194 }
193 if (tmp > 0) { 195 if (tmp > 0) {
194 tmp = __shrink_memory(tmp); 196 tmp = __shrink_memory(tmp);
195 if (!tmp) 197 if (!tmp)