fix cpu hotplug
Subsystems (2)
PATCH 1/1 fix cpu hotplug
Hi,
CPU hotplug was broken by the __meminit changes. Avoid the madness of creating a mem+cpu hotplug init attribute and just make them __devinit.
Anton
---
mm/page_alloc.c +3 -3
@@ -1799,7 +1799,7 @@ void zonetable_add(struct zone *zone, in memmap_init_zone((size), (nid), (zone), (start_pfn))#endif -static int __meminit zone_batchsize (struct zone *zone) +static int __devinit zone_batchsize (struct zone *zone) {int batch;
@@ -1893,7 +1893,7 @@ static struct per_cpu_pageset* Dynamically allocate memory for the * per cpu pageset array in struct zone. */ -static int __meminit process_zones (int cpu) +static int __devinit process_zones (int cpu) {struct zone *zone, *dzone;
@@ -1934,7 +1934,7 @@ static inline void free_zone_pagesets(in } } -static int __meminit pageset_cpuup_callback (struct notifier_block *nfb, +static int __devinit pageset_cpuup_callback (struct notifier_block *nfb,unsigned long action,void *hcpu) {
Quoted 35 lines · Anton Blanchard
Hi,
CPU hotplug was broken by the
__meminitchanges. Avoid the madness of creating a mem+cpu hotplug init attribute and just make them__devinit.Anton
Signed-off-by Anton Blanchard <[email protected]>---
Index:
build/mm/page_alloc.c
===================================================================mm/page_alloc.c +2
-2@@ -1799,7 +1799,7 @@ void zonetable_add(struct zone *zone, in memmap_init_zone((size), (nid), (zone), (start_pfn))#endif -static int __meminit zone_batchsize (struct zone *zone) +static int __devinit zone_batchsize (struct zone *zone) {int batch;@@ -1893,7 +1893,7 @@ static struct per_cpu_pageset* Dynamically allocate memory for the * per cpu pageset array in struct zone. */ -static int __meminit process_zones (int cpu) +static int __devinit process_zones (int cpu) {struct zone *zone, *dzone;
mm/page_alloc.c static inline void free_zone_pagesets(in · line 1940
Quoted 8 lines
mm/page_alloc.c +1
-1@@ -1934,7 +1934,7 @@ static inline void free_zone_pagesets(in } } -static int __meminit pageset_cpuup_callback (struct notifier_block *nfb, +static int __devinit pageset_cpuup_callback (struct notifier_block *nfb,unsigned long action,void *hcpu) {
These are __cpuinit in Linus's current tree. Which probably means that we're busted with hotplug-memory && !hotplug-cpu.
I don't think we want to make these __devinit, because that would penalise systems which are hotplug && !hotplug-memory && !hotplug-cpu, which are the systems which can least afford the memory waste.
So really, yes, we need the madness of mem+cpu.
Or we can do
static int __cpuinit __meminit foo(void)
{
}
Which actually seems to work.