Skip to content

Commit

Permalink
[PATCH] swsusp: take lowmem reserves into account
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Jun 23, 2006
1 parent 3e3318d commit a938c35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/power/swsusp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a938c35

Please sign in to comment.