Skip to contentSkip to conversation

perf: Fix CPU hotplug

tip:perf/core tip-bot for Peter Zijlstra 1 participant 1 message Sep 9, 2010

lore
Share & tools
lore
#0 lore raw
Commit-ID:  5e11637e2c929e34dcc0fbbfb48bdb638937701a
Gitweb:     http://git.kernel.org/tip/5e11637e2c929e34dcc0fbbfb48bdb638937701a
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Fri, 11 Jun 2010 13:35:08 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 9 Sep 2010 20:38:52 +0200

perf: Fix CPU hotplug

Since we have UP_PREPARE, we should also have UP_CANCELED.

LKML-Reference: <new-submission>

---
 kernel/perf_event.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
kernel/perf_event.c +3 -3
index 657555a..db5b560 100644
@@ -5761,15 +5761,15 @@ perf_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu)
 {
 	unsigned int cpu = (long)hcpu;
 
-	switch (action) {
+	switch (action & ~CPU_TASKS_FROZEN) {
 
 	case CPU_UP_PREPARE:
-	case CPU_UP_PREPARE_FROZEN:
+	case CPU_DOWN_FAILED:
 		perf_event_init_cpu(cpu);
 		break;
 
+	case CPU_UP_CANCELED:
 	case CPU_DOWN_PREPARE:
-	case CPU_DOWN_PREPARE_FROZEN:
 		perf_event_exit_cpu(cpu);
 		break;