]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Drain local pages to make swsusp work
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 13 Jan 2003 12:14:54 +0000 (04:14 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Mon, 13 Jan 2003 12:14:54 +0000 (04:14 -0800)
From:  Pavel Machek <pavel@ucw.cz>

  With local pages present, swsusp's accounting goes wrong and you get
  nice BUG(). This fixes it, please apply.

kernel/suspend.c

index 3e4b1729c5b160272ae049e2f62b0db2c2356ad8..3c55c284b537f90b41c45cde46e204c8b40a54d1 100644 (file)
@@ -680,6 +680,8 @@ static int suspend_prepare_image(void)
        struct sysinfo i;
        unsigned int nr_needed_pages = 0;
 
+       drain_local_pages();
+
        pagedir_nosave = NULL;
        printk( "/critical section: Counting pages to copy" );
        nr_copy_pages = count_and_copy_data_pages(NULL);
@@ -714,6 +716,7 @@ static int suspend_prepare_image(void)
        nr_copy_pages_check = nr_copy_pages;
        pagedir_order_check = pagedir_order;
 
+       drain_local_pages();    /* During allocating of suspend pagedir, new cold pages may appear. Kill them */
        if (nr_copy_pages != count_and_copy_data_pages(pagedir_nosave)) /* copy */
                BUG();