dect
/
linux-2.6
Archived
13
0
Fork 0

[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>
This commit is contained in:
Rafael J. Wysocki 2006-06-23 02:04:46 -07:00 committed by Linus Torvalds
parent 3e3318dee0
commit a938c356d5
1 changed files with 3 additions and 1 deletions

View File

@ -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)