mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-16 19:47:55 +00:00
[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>
This commit is contained in:
parent
418106d624
commit
c75fd0ee6e
1 changed files with 1 additions and 1 deletions
|
@ -229,13 +229,13 @@ int swsusp_shrink_memory(void)
|
||||||
size += highmem_size;
|
size += highmem_size;
|
||||||
for_each_zone (zone)
|
for_each_zone (zone)
|
||||||
if (populated_zone(zone)) {
|
if (populated_zone(zone)) {
|
||||||
|
tmp += snapshot_additional_pages(zone);
|
||||||
if (is_highmem(zone)) {
|
if (is_highmem(zone)) {
|
||||||
highmem_size -=
|
highmem_size -=
|
||||||
zone_page_state(zone, NR_FREE_PAGES);
|
zone_page_state(zone, NR_FREE_PAGES);
|
||||||
} else {
|
} else {
|
||||||
tmp -= zone_page_state(zone, NR_FREE_PAGES);
|
tmp -= zone_page_state(zone, NR_FREE_PAGES);
|
||||||
tmp += zone->lowmem_reserve[ZONE_NORMAL];
|
tmp += zone->lowmem_reserve[ZONE_NORMAL];
|
||||||
tmp += snapshot_additional_pages(zone);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue