Skip to contentSkip to conversation

ARM: perf-events: request PMU interrupts with IRQF_NOBALANCING

PATCH New Will Deacon 2 participants 2 messages Feb 25, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: perf-events: request PMU interrupts with IRQF_NOBALANCING

If IRQ balancing is used on a multicore ARM system, PMU interrupt lines may be relocated onto CPUs other than the one causing the counter overflow. This can result in misattribution of events to the wrong core and, in the case that the CPU handling the interrupt has not experience counter overflow, the interrupt can be disabled because the handler returns IRQ_NONE.

This patch adds the IRQF_NOBALANCING flag to the request_irq call in perf_events.c.

---
 arch/arm/kernel/perf_event.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/kernel/perf_event.c +2 -1
index c54ceb3..b44d159 100644
@@ -332,7 +332,8 @@ armpmu_reserve_hardware(void)
 
 	for (i = 0; i < pmu_irqs->num_irqs; ++i) {
 		err = request_irq(pmu_irqs->irqs[i], armpmu->handle_irq,
-				  IRQF_DISABLED, "armpmu", NULL);
+				  IRQF_DISABLED | IRQF_NOBALANCING,
+				  "armpmu", NULL);
 		if (err) {
 			pr_warning("unable to request IRQ%d for ARM "
 				   "perf counters\n", pmu_irqs->irqs[i]);
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 1/1 ARM: perf-events: request PMU interrupts with IRQF_NOBALANCING

Quoted 32 lines · Will Deacon

If IRQ balancing is used on a multicore ARM system, PMU interrupt lines may be relocated onto CPUs other than the one causing the counter overflow. This can result in misattribution of events to the wrong core and, in the case that the CPU handling the interrupt has not experience counter overflow, the interrupt can be disabled because the handler returns IRQ_NONE.

This patch adds the IRQF_NOBALANCING flag to the request_irq call in perf_events.c.

---
 arch/arm/kernel/perf_event.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/kernel/perf_event.c +2 -1
index c54ceb3..b44d159 100644
@@ -332,7 +332,8 @@ armpmu_reserve_hardware(void)
 
 	for (i = 0; i < pmu_irqs->num_irqs; ++i) {
 		err = request_irq(pmu_irqs->irqs[i], armpmu->handle_irq,
-				  IRQF_DISABLED, "armpmu", NULL);
+				  IRQF_DISABLED | IRQF_NOBALANCING,
+				  "armpmu", NULL);
 		if (err) {
 			pr_warning("unable to request IRQ%d for ARM "
 				   "perf counters\n", pmu_irqs->irqs[i]);
Signature · 1 line
1.6.3.3

Hi Will,

Looks good to me.

Jamie