aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/perf_event.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 244ca3acb0ee..c5fa717cf099 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -5380,6 +5380,8 @@ free_dev:
5380 goto out; 5380 goto out;
5381} 5381}
5382 5382
5383static struct lock_class_key cpuctx_mutex;
5384
5383int perf_pmu_register(struct pmu *pmu, char *name, int type) 5385int perf_pmu_register(struct pmu *pmu, char *name, int type)
5384{ 5386{
5385 int cpu, ret; 5387 int cpu, ret;
@@ -5428,6 +5430,7 @@ skip_type:
5428 5430
5429 cpuctx = per_cpu_ptr(pmu->pmu_cpu_context, cpu); 5431 cpuctx = per_cpu_ptr(pmu->pmu_cpu_context, cpu);
5430 __perf_event_init_context(&cpuctx->ctx); 5432 __perf_event_init_context(&cpuctx->ctx);
5433 lockdep_set_class(&cpuctx->ctx.mutex, &cpuctx_mutex);
5431 cpuctx->ctx.type = cpu_context; 5434 cpuctx->ctx.type = cpu_context;
5432 cpuctx->ctx.pmu = pmu; 5435 cpuctx->ctx.pmu = pmu;
5433 cpuctx->jiffies_interval = 1; 5436 cpuctx->jiffies_interval = 1;