Skip to content

Commit

Permalink
softirqs, debug: preemption check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Oct 2, 2008
1 parent 978b011 commit 8e85b4b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kernel/softirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,18 @@ asmlinkage void __do_softirq(void)

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++;
Expand Down

0 comments on commit 8e85b4b

Please sign in to comment.