2.6.2-rc2-mm2 CPU Hotplug
Subsystems (4)
PATCH 2/4 2.6.2-rc2-mm2 CPU Hotplug
Like CONFIG_PM, CONFIG_HOTPLUG_CPU wants drain_local_pages(), except we want to drain another (dead) CPU. Trivial change, mainly fixing up callers.
Name: Change drain_local_pages() To Take a CPU Number
Author: Rusty Russell
Status: Booted on 2.6.2-rc2-bk2
D: Hotplug CPU needs to drain pages on a downed CPU (usually it's the
D: current cpu). Make it an argument, and expose it if CONFIG_HOTPLUG_CPU
D: as well as CONFIG_PM.
include/linux/suspend.h +1 -1
@@ -43,7 +43,7 @@ struct suspend_header {extern int shrink_mem (void );/* mm/page_alloc.c */ -extern void drain_local_pages (void ); +extern void drain_local_pages (unsigned int cpu); extern unsigned int nr_copy_pages __nosavedata; extern suspend_pagedir_t *pagedir_nosave __nosavedata;
mm/page_alloc.c +5 -3
@@ -413,11 +413,13 @@ int is_head_of_free_region(struct page *spin_unlock_irqrestore (&zone->lock, flags);return 0 ; } +#endif /* CONFIG_PM */ +#if defined(CONFIG_PM ) || defined(CONFIG_HOTPLUG_CPU )/* * Spill all of this CPU's per-cpu pages back into the buddy allocator. */ -void drain_local_pages (void ) +void drain_local_pages (unsigned int cpu) {unsigned long flags;struct zone *zone;
@@ -427,7 +429,7 @@ void drain_local_pages(void)for_each_zone (zone) {struct per_cpu_pageset *pset; - pset = &zone->pageset[smp_processor_id ()]; + pset = &zone->pageset[cpu];for (i =0 ; i <ARRAY_SIZE (pset->pcp); i++) {struct per_cpu_pages *pcp;
@@ -438,7 +440,7 @@ void drain_local_pages(void) }local_irq_restore (flags); } -#endif /* CONFIG_PM */ +#endif /* CONFIG_PM || CONFIG_HOTPLUG_CPU */ /* * Free a 0-order page
kernel/power/pmdisk.c +2 -2
@@ -627,7 +627,7 @@ int pmdisk_suspend(void)if ((error =read_swapfiles ()))return error; -drain_local_pages (); +drain_local_pages (smp_processor_id ()); pm_pagedir_nosave =NULL ;pr_debug ("pmdisk: Counting pages to copy.\n" );
@@ -658,7 +658,7 @@ int pmdisk_suspend(void)/* During allocating of suspend pagedir, new cold pages may appear. * Kill them */ -drain_local_pages (); +drain_local_pages (smp_processor_id ());/* copy */ copy_pages ();
kernel/power/swsusp.c +2 -2
@@ -520,7 +520,7 @@ static int suspend_prepare_image(void)struct sysinfo i;unsigned int nr_needed_pages =0 ; -drain_local_pages (); +drain_local_pages (smp_processor_id ()); pagedir_nosave =NULL ;printk ("/critical section: Counting pages to copy" );
@@ -553,7 +553,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 */ +drain_local_pages (smp_processor_id ());/* 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 ();
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.