]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - kernel/power/swsusp.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
[linux-2.6.git] / kernel / power / swsusp.c
index 62752899b1a1f32dcee8d547599e1cad2708e521..0b66659dc516f13eed980412dc196781ffa6892e 100644 (file)
@@ -193,14 +193,13 @@ int swsusp_shrink_memory(void)
        printk("Shrinking memory...  ");
        do {
                size = 2 * count_highmem_pages();
-               size += size / 50 + count_data_pages();
-               size += (size + PBES_PER_PAGE - 1) / PBES_PER_PAGE +
-                       PAGES_FOR_IO;
+               size += size / 50 + count_data_pages() + PAGES_FOR_IO;
                tmp = size;
                for_each_zone (zone)
                        if (!is_highmem(zone) && populated_zone(zone)) {
                                tmp -= zone->free_pages;
                                tmp += zone->lowmem_reserve[ZONE_NORMAL];
+                               tmp += snapshot_additional_pages(zone);
                        }
                if (tmp > 0) {
                        tmp = __shrink_memory(tmp);