Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf: arm_pmu: Kill last use of per-CPU cpu_armpmu pointer

Having removed the use of the cpu_armpmu per-CPU variable from the
interrupt handling, the only user left is the BRBE scheduler hook.

It is easy to drop the use of this variable by following the pointer to the
generic PMU structure, and get the arm_pmu structure from there.

Perform the conversion and kill cpu_armpmu altogether.

Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Will Deacon <will@kernel.org>
Link: https://patch.msgid.link/20251020122944.3074811-27-maz@kernel.org

authored by

Marc Zyngier and committed by
Thomas Gleixner
fa9d2777 ebac4649

+1 -8
-5
drivers/perf/arm_pmu.c
··· 104 104 .free_pmuirq = armpmu_free_percpu_pmunmi 105 105 }; 106 106 107 - DEFINE_PER_CPU(struct arm_pmu *, cpu_armpmu); 108 107 static DEFINE_PER_CPU(int, cpu_irq); 109 108 static DEFINE_PER_CPU(const struct pmu_irq_ops *, cpu_irq_ops); 110 109 ··· 724 725 if (pmu->reset) 725 726 pmu->reset(pmu); 726 727 727 - per_cpu(cpu_armpmu, cpu) = pmu; 728 - 729 728 irq = armpmu_get_cpu_irq(pmu, cpu); 730 729 if (irq) 731 730 per_cpu(cpu_irq_ops, cpu)->enable_pmuirq(irq); ··· 742 745 irq = armpmu_get_cpu_irq(pmu, cpu); 743 746 if (irq) 744 747 per_cpu(cpu_irq_ops, cpu)->disable_pmuirq(irq); 745 - 746 - per_cpu(cpu_armpmu, cpu) = NULL; 747 748 748 749 return 0; 749 750 }
+1 -1
drivers/perf/arm_pmuv3.c
··· 1064 1064 static void armv8pmu_sched_task(struct perf_event_pmu_context *pmu_ctx, 1065 1065 struct task_struct *task, bool sched_in) 1066 1066 { 1067 - struct arm_pmu *armpmu = *this_cpu_ptr(&cpu_armpmu); 1067 + struct arm_pmu *armpmu = to_arm_pmu(pmu_ctx->pmu); 1068 1068 struct pmu_hw_events *hw_events = this_cpu_ptr(armpmu->hw_events); 1069 1069 1070 1070 if (!hw_events->branch_users)
-2
include/linux/perf/arm_pmu.h
··· 132 132 133 133 #define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu)) 134 134 135 - DECLARE_PER_CPU(struct arm_pmu *, cpu_armpmu); 136 - 137 135 u64 armpmu_event_update(struct perf_event *event); 138 136 139 137 int armpmu_event_set_period(struct perf_event *event);