[PATCH] SMP support for drain local pages.

From: Nigel Cunningham
Date: Wed May 26 2004 - 17:23:53 EST


From: Nigel Cunningham <ncunningham@xxxxxxxxxxxxx>

Hi.

This patch adds SMP support for drain_local_pages, so that suspend
implementations can drain pcp structures on all CPUs and thus accurately
determine which pages are free.

Please apply.

diff -ruN 2.6.6-current-bk/mm/page_alloc.c smp-drain-local-pages/mm/page_alloc.c
--- 2.6.6-current-bk/mm/page_alloc.c 2004-05-26 19:47:15.000000000 +1000
+++ smp-drain-local-pages/mm/page_alloc.c 2004-05-26 19:56:19.000000000 +1000
@@ -459,6 +459,24 @@
__drain_pages(smp_processor_id());
local_irq_restore(flags);
}
+
+#ifdef CONFIG_SMP
+static void __smp_drain_local_pages(void * data)
+{
+ drain_local_pages();
+}
+
+void smp_drain_local_pages(void)
+{
+ smp_call_function(__smp_drain_local_pages, NULL, 0, 1);
+ drain_local_pages();
+}
+#else
+void smp_drain_local_pages(void)
+{
+ drain_local_pages();
+}
+#endif
#endif /* CONFIG_PM */

static void zone_statistics(struct zonelist *zonelist, struct zone *z)



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/