Skip to contentSkip to conversation

Drain local pages to make swsusp work

TRIVIAL Rusty Trivial Russell 1 participant 1 message Jan 14, 2003

lore
Share & tools
lore
#0 lore raw

From: Pavel Machek <[email protected]>

Hi!

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

kernel/suspend.c renamed from kernel/suspend.c.orig +3 -0
@@ -680,6 +680,8 @@
 	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 @@
 	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();
 
Signature · 2 lines
  Don't blame me: the Monkey is driving
  File: Pavel Machek <[email protected]>: Drain local pages to make swsusp work