aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/softirq.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-10-02 04:50:53 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-02 04:58:04 -0400
commit8e85b4b553fc932e1c5141feb5fda389b7f5db01 (patch)
tree2e3f1894e36be800aadeac7ed86ebb4f9fb992a3 /kernel/softirq.c
parent978b0116cd225682a29e3d1d5010319bf2de32c2 (diff)
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 <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/softirq.c')
-rw-r--r--kernel/softirq.c11
1 files changed, 11 insertions, 0 deletions
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:
205 205
206 do { 206 do {
207 if (pending & 1) { 207 if (pending & 1) {
208 int prev_count = preempt_count();
209
208 h->action(h); 210 h->action(h);
211
212 if (unlikely(prev_count != preempt_count())) {
213 printk(KERN_ERR "huh, entered sotfirq %ld %p"
214 "with preempt_count %08x,"
215 " exited with %08x?\n", h - softirq_vec,
216 h->action, prev_count, preempt_count());
217 preempt_count() = prev_count;
218 }
219
209 rcu_bh_qsctr_inc(cpu); 220 rcu_bh_qsctr_inc(cpu);
210 } 221 }
211 h++; 222 h++;