diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2007-04-04 22:08:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-05 00:12:47 -0400 |
commit | c75fd0ee6e1750e6e527ed1d4aeee66739d9ad79 (patch) | |
tree | 67f8787f04f388b4f201a07a8106204007e336cd /kernel/power | |
parent | 418106d6248618bca1add65168a82974c72206db (diff) |
[PATCH] swsusp: fix memory shrinker
Fix a bug in the swsusp's memory shrinker that causes some systems using
highmem to refuse to suspend to disk if image_size is set above 1/2 of
available RAM.
Special thanks to Jiri Slaby for reporting the problem and assistance in
debugging it.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/swsusp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 7fb834397a0d..175370824f37 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c | |||
@@ -229,13 +229,13 @@ int swsusp_shrink_memory(void) | |||
229 | size += highmem_size; | 229 | size += highmem_size; |
230 | for_each_zone (zone) | 230 | for_each_zone (zone) |
231 | if (populated_zone(zone)) { | 231 | if (populated_zone(zone)) { |
232 | tmp += snapshot_additional_pages(zone); | ||
232 | if (is_highmem(zone)) { | 233 | if (is_highmem(zone)) { |
233 | highmem_size -= | 234 | highmem_size -= |
234 | zone_page_state(zone, NR_FREE_PAGES); | 235 | zone_page_state(zone, NR_FREE_PAGES); |
235 | } else { | 236 | } else { |
236 | tmp -= zone_page_state(zone, NR_FREE_PAGES); | 237 | tmp -= zone_page_state(zone, NR_FREE_PAGES); |
237 | tmp += zone->lowmem_reserve[ZONE_NORMAL]; | 238 | tmp += zone->lowmem_reserve[ZONE_NORMAL]; |
238 | tmp += snapshot_additional_pages(zone); | ||
239 | } | 239 | } |
240 | } | 240 | } |
241 | 241 | ||