From: Thomas Gleixner Date: Thu, 2 Oct 2008 08:50:53 +0000 (+0200) Subject: softirqs, debug: preemption check X-Git-Tag: v2.6.28-rc1~271^2^3~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8e85b4b553fc932e1c5141feb5fda389b7f5db01;p=karo-tx-linux.git softirqs, debug: preemption check 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 Signed-off-by: Ingo Molnar --- diff --git a/kernel/softirq.c b/kernel/softirq.c index 82e32aadedd8..1cf1e2f2c406 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -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++;