[PATCH 5/6] perf: Fix perf_event_exit_cpu_context()

From: Peter Zijlstra
Date: Fri Sep 17 2010 - 05:35:19 EST


Use the right cpu-context.. spotted by preempt warning on hot-unplug

Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
kernel/perf_event.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6/kernel/perf_event.c
===================================================================
--- linux-2.6.orig/kernel/perf_event.c
+++ linux-2.6/kernel/perf_event.c
@@ -6259,14 +6259,13 @@ static void perf_event_exit_cpu_context(

idx = srcu_read_lock(&pmus_srcu);
list_for_each_entry_rcu(pmu, &pmus, entry) {
- ctx = &this_cpu_ptr(pmu->pmu_cpu_context)->ctx;
+ ctx = &per_cpu_ptr(pmu->pmu_cpu_context, cpu)->ctx;

mutex_lock(&ctx->mutex);
smp_call_function_single(cpu, __perf_event_exit_context, ctx, 1);
mutex_unlock(&ctx->mutex);
}
srcu_read_unlock(&pmus_srcu, idx);
-
}

static void perf_event_exit_cpu(int cpu)


--
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/