Skip to contentSkip to conversation

x86/irq: handle chained interrupts during IRQ migration

PATCH Superseded Sundar Iyer 3 participants 4 messages May 29, 2012 – May 31, 2012 x86

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/irq: handle chained interrupts during IRQ migration

Chained interrupt handlers dont have an irqaction and hence are not handled during migrating interrupts when some cores go offline.

Handle this by introducing a irq_is_chained() check which is based on the IRQ_NOREQUEST flag being set for such interrupts. fixup_irq() can then handle such interrupts and not skip them over.

---
v1: use accessors instead of new variables to identify chained irqs

 arch/x86/kernel/irq.c   |    6 ++++--
 include/linux/irqdesc.h |   10 ++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
arch/x86/kernel/irq.c +4 -2
index 6c0802e..acd7949 100644
@@ -249,8 +249,10 @@ void fixup_irqs(void)
 
 		data = irq_desc_get_irq_data(desc);
 		affinity = data->affinity;
-		if (!irq_has_action(irq) || irqd_is_per_cpu(data) ||
-		    cpumask_subset(affinity, cpu_online_mask)) {
+		/* include IRQs who have no action, but are chained */
+		if ((!irq_has_action(irq) && irq_is_chained(irq)) ||
+			irqd_is_per_cpu(data) ||
+			cpumask_subset(affinity, cpu_online_mask)) {
 			raw_spin_unlock(&desc->lock);
 			continue;
 		}
include/linux/irqdesc.h +10 -0
index 2d921b3..7880722 100644
@@ -120,6 +120,16 @@ static inline int irq_has_action(unsigned int irq)
 	return desc->action != NULL;
 }
 
+/*
+ * Test to see if the IRQ is chained; it would not be requested and hence
+ * _IRQ_NOREQUEST would be set
+ */
+static inline int irq_is_chained(unsigned int irq)
+{
+	struct irq_desc *desc = irq_to_desc(irq);
+	return !(desc->status_use_accessors & IRQ_NOREQUEST);
+}
+
 /* caller has locked the irq_desc and both params are valid */
 static inline void __irq_set_handler_locked(unsigned int irq,
 					    irq_flow_handler_t handler)
Signature · 1 line
1.7.1
#1 lore raw
Quoted 8 lines · Sundar Iyer
include/linux/irqdesc.h +0 -0
index 2d921b3..7880722 100644
@@ -120,6 +120,16 @@ static inline int irq_has_action(unsigned int irq)
 	return desc->action != NULL;
 }
 

include/linux/irqdesc.h static inline int irq_has_action(unsigned int irq) · line 132

Quoted 10 lines
include/linux/irqdesc.h +10 -0
+/*
+ * Test to see if the IRQ is chained; it would not be requested and hence
+ * _IRQ_NOREQUEST would be set
+ */
+static inline int irq_is_chained(unsigned int irq)
+{
+	struct irq_desc *desc = irq_to_desc(irq);
+	return !(desc->status_use_accessors & IRQ_NOREQUEST);
+}
+

This approach looks highly suspect. There are many non-chained cases that are also NOREQUEST. Chained IRQs are at the very least NOREQUEST, NOPROBE, and NOTHREAD. You could test a mask of those and at least have a vague change of not catching other unrelated IRQs. It would still be a hack though, given that none of those status flags in and of themselves require an IRQ to be chained.

#2 lore raw
In reply to Sundar Iyer
Quoted 6 lines · Sundar Iyer

Chained interrupt handlers dont have an irqaction and hence are not handled during migrating interrupts when some cores go offline.

Handle this by introducing a irq_is_chained() check which is based on the IRQ_NOREQUEST flag being set for such interrupts. fixup_irq() can then handle such interrupts and not skip them over.

No, we need a separate flag for those. IRQ_NORREQUEST is not a reliable indicator.

Thanks,

tglx

#3 lore raw
Quoted 9 lines

-----Original Message-----
From: Thomas Gleixner [mailto:[email protected]]
Sent: Thursday, May 31, 2012 1:01 PM

Quoted 4 lines

Handle this by introducing a irq_is_chained() check which is based on the IRQ_NOREQUEST flag being set for such interrupts. fixup_irq() can then handle such interrupts and not skip them over.

No, we need a separate flag for those. IRQ_NORREQUEST is not a reliable indicator.

I posted a v2 for this patch with all the flags; else will it be okay me adding a new flag called IRQ_CHAINED and a new function similar to set_noprobe* helpers?

Cheers!