Commit 1314cad1 authored by Robert Love's avatar Robert Love Committed by Linus Torvalds

[PATCH] bad: schedule() with irqs disabled!

OK, Linus, you are right... there are enough instances of this we are
not going to find them all (although I suspect Andrew's slab.c fixes
will cover most of the cases).  Further, I think we can should actually
purposely call preempt_schedule() in certain cases after interrupt
reenable to check for reschedules...

Let's just make it a rule "no preemption if interrupts are off" and
enforce that.
parent d3a7fafa
...@@ -1032,15 +1032,12 @@ asmlinkage void preempt_schedule(void) ...@@ -1032,15 +1032,12 @@ asmlinkage void preempt_schedule(void)
{ {
struct thread_info *ti = current_thread_info(); struct thread_info *ti = current_thread_info();
if (unlikely(ti->preempt_count)) /*
return; * If there is a non-zero preempt_count or interrupts are disabled,
if (unlikely(irqs_disabled())) { * we do not want to preempt the current task. Just return..
preempt_disable(); */
printk("bad: schedule() with irqs disabled!\n"); if (unlikely(ti->preempt_count || irqs_disabled()))
show_stack(NULL);
preempt_enable_no_resched();
return; return;
}
need_resched: need_resched:
ti->preempt_count = PREEMPT_ACTIVE; ti->preempt_count = PREEMPT_ACTIVE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment