aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/perf_event.h1
-rw-r--r--kernel/events/core.c31
2 files changed, 1 insertions, 31 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index dfa725723f28..5c58e93c130c 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -785,7 +785,6 @@ struct perf_cpu_context {
785 ktime_t hrtimer_interval; 785 ktime_t hrtimer_interval;
786 unsigned int hrtimer_active; 786 unsigned int hrtimer_active;
787 787
788 struct pmu *unique_pmu;
789#ifdef CONFIG_CGROUP_PERF 788#ifdef CONFIG_CGROUP_PERF
790 struct perf_cgroup *cgrp; 789 struct perf_cgroup *cgrp;
791 struct list_head cgrp_cpuctx_entry; 790 struct list_head cgrp_cpuctx_entry;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 928a818d912e..d92c7ad7715d 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2932,7 +2932,7 @@ static void perf_pmu_sched_task(struct task_struct *prev,
2932 return; 2932 return;
2933 2933
2934 list_for_each_entry(cpuctx, this_cpu_ptr(&sched_cb_list), sched_cb_entry) { 2934 list_for_each_entry(cpuctx, this_cpu_ptr(&sched_cb_list), sched_cb_entry) {
2935 pmu = cpuctx->unique_pmu; /* software PMUs will not have sched_task */ 2935 pmu = cpuctx->ctx.pmu; /* software PMUs will not have sched_task */
2936 2936
2937 if (WARN_ON_ONCE(!pmu->sched_task)) 2937 if (WARN_ON_ONCE(!pmu->sched_task))
2938 continue; 2938 continue;
@@ -8636,37 +8636,10 @@ static struct perf_cpu_context __percpu *find_pmu_context(int ctxn)
8636 return NULL; 8636 return NULL;
8637} 8637}
8638 8638
8639static void update_pmu_context(struct pmu *pmu, struct pmu *old_pmu)
8640{
8641 int cpu;
8642
8643 for_each_possible_cpu(cpu) {
8644 struct perf_cpu_context *cpuctx;
8645
8646 cpuctx = per_cpu_ptr(pmu->pmu_cpu_context, cpu);
8647
8648 if (cpuctx->unique_pmu == old_pmu)
8649 cpuctx->unique_pmu = pmu;
8650 }
8651}
8652
8653static void free_pmu_context(struct pmu *pmu) 8639static void free_pmu_context(struct pmu *pmu)
8654{ 8640{
8655 struct pmu *i;
8656
8657 mutex_lock(&pmus_lock); 8641 mutex_lock(&pmus_lock);
8658 /*
8659 * Like a real lame refcount.
8660 */
8661 list_for_each_entry(i, &pmus, entry) {
8662 if (i->pmu_cpu_context == pmu->pmu_cpu_context) {
8663 update_pmu_context(i, pmu);
8664 goto out;
8665 }
8666 }
8667
8668 free_percpu(pmu->pmu_cpu_context); 8642 free_percpu(pmu->pmu_cpu_context);
8669out:
8670 mutex_unlock(&pmus_lock); 8643 mutex_unlock(&pmus_lock);
8671} 8644}
8672 8645
@@ -8870,8 +8843,6 @@ skip_type:
8870 cpuctx->ctx.pmu = pmu; 8843 cpuctx->ctx.pmu = pmu;
8871 8844
8872 __perf_mux_hrtimer_init(cpuctx, cpu); 8845 __perf_mux_hrtimer_init(cpuctx, cpu);
8873
8874 cpuctx->unique_pmu = pmu;
8875 } 8846 }
8876 8847
8877got_cpu_context: 8848got_cpu_context: