Skip to contentSkip to conversation

Use real time pcp locking for page draining during cpu unplug

PATCH New Andi Kleen 1 participant 1 message Dec 7, 2007

Subsystems (2)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 Use real time pcp locking for page draining during cpu unplug

Use real time pcp locking for page draining during cpu unplug

Looks like a merging mistake that happened at some point. This is the only place in the file that disables interrupts directly.

This fixes one case of CPU hotunplug failing on RT, but there are still more.

mm/page_alloc.c +3 -2
Index: linux-2.6.24-rc2-rt1-hack/mm/page_alloc.c
===================================================================
@@ -4049,10 +4049,11 @@ static int page_alloc_cpu_notify(struct 
 	int cpu = (unsigned long)hcpu;
 
 	if (action == CPU_DEAD || action == CPU_DEAD_FROZEN) {
-		local_irq_disable();
+		unsigned long flags;
+		__lock_cpu_pcp(&flags, cpu);
 		__drain_pages(cpu);
 		vm_events_fold_cpu(cpu);
-		local_irq_enable();
+		unlock_cpu_pcp(flags, cpu);
 		refresh_cpu_vm_stats(cpu);
 	}
 	return NOTIFY_OK;