blob: 8fb38c63bddd84c46e25799220b3dc453339214d [file] [log] [blame]
Subject: softirq: Add more debugging
From: Thomas Gleixner <tglx@linutronix.de>
Date: Sun, 28 Oct 2012 15:21:59 +0000
We really want to find code which calls __raise_softirq_irqsoff() and
runs neither in hardirq context nor in a local_bh disabled
region. This is even wrong on mainline as that code relies on random
events to take care of it's newly raised softirq.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/softirq.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
Index: linux-stable/kernel/softirq.c
===================================================================
--- linux-stable.orig/kernel/softirq.c
+++ linux-stable/kernel/softirq.c
@@ -618,7 +618,7 @@ void thread_do_softirq(void)
}
}
-void __raise_softirq_irqoff(unsigned int nr)
+static void do_raise_softirq_irqoff(unsigned int nr)
{
trace_softirq_raise(nr);
or_softirq_pending(1UL << nr);
@@ -635,12 +635,19 @@ void __raise_softirq_irqoff(unsigned int
__this_cpu_read(ksoftirqd)->softirqs_raised |= (1U << nr);
}
+void __raise_softirq_irqoff(unsigned int nr)
+{
+ do_raise_softirq_irqoff(nr);
+ if (!in_irq() && !current->softirq_nestcnt)
+ wakeup_softirqd();
+}
+
/*
* This function must run with irqs disabled!
*/
void raise_softirq_irqoff(unsigned int nr)
{
- __raise_softirq_irqoff(nr);
+ do_raise_softirq_irqoff(nr);
/*
* If we're in an hard interrupt we let irq return code deal
@@ -662,11 +669,6 @@ void raise_softirq_irqoff(unsigned int n
wakeup_softirqd();
}
-void do_raise_softirq_irqoff(unsigned int nr)
-{
- raise_softirq_irqoff(nr);
-}
-
static inline int ksoftirqd_softirq_pending(void)
{
return current->softirqs_raised;