Skip to contentSkip to conversation

ARM: Allow forced irq threading

PATCH New Thomas Gleixner 5 participants 12 messages Feb 14, 2013 – Aug 14, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover ARM: Allow forced irq threading

Forced irq threading is a prerequisite for RT and a nice debug feature (enabled via commandline option) in mainline.

The following series adds the tiny missing pieces to enable this on the arm architecture.

Thanks,

tglx

#2 lore raw

PATCH 1/2 arm: Mark pmu interupt IRQF_NO_THREAD

Quoted 14 lines · Thomas Gleixner

PMU interrupts must not be threaded.

---
 arch/arm/kernel/perf_event_cpu.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/arch/arm/kernel/perf_event_cpu.c
===================================================================

arch/arm/kernel/perf_event_cpu.c static int cpu_pmu_request_irq(struct ar · line 125

Quoted 9 lines
arch/arm/kernel/perf_event_cpu.c +2 -1
@@ -118,7 +118,8 @@ static int cpu_pmu_request_irq(struct ar
 			continue;
 		}
 
-		err = request_irq(irq, handler, IRQF_NOBALANCING, "arm-pmu",
+		err = request_irq(irq, handler,
+				  IRQF_NOBALANCING | IRQF_NO_THREAD, "arm-pmu",
 				  cpu_pmu);
 		if (err) {
 			pr_err("unable to request IRQ%d for ARM PMU counters\n",

Yup, we certainly don't want these to be threaded! Cheers, I'll add this to my perf queue.

Will

#3 lore raw

PATCH 1/2 arm: Mark pmu interupt IRQF_NO_THREAD

Quoted 2 lines · Will Deacon

Yup, we certainly don't want these to be threaded! Cheers, I'll add this to my perf queue.

I don't see this in v3.10. Is there a problem with this patch?

Quoted 1 line

Will

Sebastian

#4 lore raw

PATCH 1/2 arm: Mark pmu interupt IRQF_NO_THREAD

Quoted 5 lines · Sebastian Andrzej Siewior
Quoted 2 lines · Will Deacon

Yup, we certainly don't want these to be threaded! Cheers, I'll add this to my perf queue.

I don't see this in v3.10. Is there a problem with this patch?

Nope, I was just waiting for the discussion to die down around the kconfig change in the second patch.

Probably best to submit both to Russell's patch system[1], with my ack on this one:

Will

[1] Add a "KernelVersion: 3.11-rc5" line to the patch, then git send-email it to patches at arm.linux.org.uk.

#5 lore raw

PATCH 1/2 arm: Mark pmu interupt IRQF_NO_THREAD

Quoted 2 lines · Will Deacon

Probably best to submit both to Russell's patch system[1], with my ack on this one:

Okay, will do. Thanks.

Quoted 2 lines

Will

Sebastian

#7 lore raw

PATCH 2/2 arm: Allow forced irq threading

Quoted 2 lines · Thomas Gleixner

All timer interrupts and the perf interrupt are marked NO_THREAD, so its safe to allow forced interrupt threading.

What effect does this have on IRQ latency, particularly on the slower CPUs?

If it adds to the IRQ latency, then it must be conditional; there are platforms where IRQ latency is important for things like network devices to keep up (particularly the SMC NICs).

#8 lore raw

PATCH 2/2 arm: Allow forced irq threading

Quoted 9 lines · Russell King - ARM Linux
Quoted 2 lines · Thomas Gleixner

All timer interrupts and the perf interrupt are marked NO_THREAD, so its safe to allow forced interrupt threading.

What effect does this have on IRQ latency, particularly on the slower CPUs?

If it adds to the IRQ latency, then it must be conditional; there are platforms where IRQ latency is important for things like network devices to keep up (particularly the SMC NICs).

It does not affect anything unless you add "threadirqs" to the kernel command line. This command line argument puts the kernel into forced irq threading mode. Otherwise it just works as now.

And yes, if enabled on the command line it adds latency due to the delayed invocation of the handler in the thread.

Though for mainline this is primary a debug mechanism where you can morph the kernel explosion in the interrupt handler into a takedown of the handler thread instead of crashing the machine completely.

Now on RT we force this and I can tell you that even on slow machines with SMC NICs the overhead seems to be in a range where these systems can cope with. Of course, if you tweak the scheduling params of the irq thread low enough you can run into problematic situations. But that's not an ARM specific problem, that's a general problem of configuring a RT system.

Thanks,

tglx

#9 lore raw

PATCH v2 2/2 arm: Allow forced irq threading

From: Thomas Gleixner <[email protected]>

All timer interrupts and the perf interrupt are marked NO_THREAD, so its safe to allow forced interrupt threading.

---

Quoted 7 lines · Thomas Gleixner
Quoted 1 line · Russell King - ARM Linux

What effect does this have on IRQ latency, particularly on the slower CPUs?

It does not affect anything unless you add "threadirqs" to the kernel command line. This command line argument puts the kernel into forced irq threading mode. Otherwise it just works as now.

I reposted the patch since it no longer applies clean on v3.11-rc5. From what tglx explained, I don't think there are any outstanding issues, are there?

 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +1 -0
index 43594d5..405e4c0 100644
@@ -20,6 +20,7 @@ config ARM
 	select GENERIC_STRNCPY_FROM_USER
 	select GENERIC_STRNLEN_USER
 	select HARDIRQS_SW_RESEND
+	select IRQ_FORCED_THREADING
 	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
 	select HAVE_ARCH_KGDB
 	select HAVE_ARCH_SECCOMP_FILTER
Signature · 1 line
1.8.4.rc1
#10 lore raw

PATCH v2 2/2 arm: Allow forced irq threading

Quoted 28 lines · Sebastian Andrzej Siewior

From: Thomas Gleixner <[email protected]>

All timer interrupts and the perf interrupt are marked NO_THREAD, so its safe to allow forced interrupt threading.

---

Quoted 7 lines · Thomas Gleixner
Quoted 1 line · Russell King - ARM Linux

What effect does this have on IRQ latency, particularly on the slower CPUs?

It does not affect anything unless you add "threadirqs" to the kernel command line. This command line argument puts the kernel into forced irq threading mode. Otherwise it just works as now.

I reposted the patch since it no longer applies clean on v3.11-rc5. From what tglx explained, I don't think there are any outstanding issues, are there?

 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +0 -0
index 43594d5..405e4c0 100644

arch/arm/Kconfig config ARM · line 23

Quoted 4 lines
arch/arm/Kconfig +1 -0
@@ -20,6 +20,7 @@ config ARM
 	select GENERIC_STRNCPY_FROM_USER
 	select GENERIC_STRNLEN_USER
 	select HARDIRQS_SW_RESEND
+	select IRQ_FORCED_THREADING

Please add in alphabetic sorted order.

arch/arm/Kconfig config ARM · line 26

Quoted 3 lines
arch/arm/Kconfig +0 -0
 	select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
 	select HAVE_ARCH_KGDB
 	select HAVE_ARCH_SECCOMP_FILTER

Thanks,
Sekhar

#11 lore raw

PATCH v3 2/2 arm: Allow forced irq threading

From: Thomas Gleixner <[email protected]>

All timer interrupts and the perf interrupt are marked NO_THREAD, so its safe to allow forced interrupt threading.

---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +1 -0
index 43594d5..6858b3a 100644
@@ -52,6 +52,7 @@ config ARM
 	select HAVE_REGS_AND_STACK_ACCESS_API
 	select HAVE_SYSCALL_TRACEPOINTS
 	select HAVE_UID16
+	select IRQ_FORCED_THREADING
 	select KTIME_SCALAR
 	select PERF_USE_VMALLOC
 	select RTC_LIB
Signature · 1 line
1.8.4.rc1