]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
softirqs, debug: preemption check
authorThomas Gleixner <tglx@linutronix.de>
Thu, 2 Oct 2008 08:50:53 +0000 (10:50 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 2 Oct 2008 08:58:04 +0000 (10:58 +0200)
if a preempt count leaks out of a softirq handler it can be very hard
to figure it out. Add a debug check for this.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/softirq.c

index 82e32aadedd84fc3b29dec79257af09608aa8194..1cf1e2f2c4062d776c022010453a00f890d11e0c 100644 (file)
@@ -205,7 +205,18 @@ restart:
 
        do {
                if (pending & 1) {
+                       int prev_count = preempt_count();
+
                        h->action(h);
+
+                       if (unlikely(prev_count != preempt_count())) {
+                               printk(KERN_ERR "huh, entered sotfirq %ld %p"
+                                      "with preempt_count %08x,"
+                                      " exited with %08x?\n", h - softirq_vec,
+                                      h->action, prev_count, preempt_count());
+                               preempt_count() = prev_count;
+                       }
+
                        rcu_bh_qsctr_inc(cpu);
                }
                h++;