From: Steven Rostedt Thomas Gleixner is adding the call to a rtmutex function in setscheduler. This call grabs a spin_lock that is not always protected by interrupts disabled. So this means that setscheduler cant be called from interrupt context. To prevent this from happening in the future, this patch adds a BUG_ON(in_interrupt()) in that function. (Thanks to akpm for this suggestion). Signed-off-by: Steven Rostedt Cc: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Andrew Morton --- kernel/sched.c | 2 ++ 1 file changed, 2 insertions(+) diff -puN kernel/sched.c~bug-if-setscheduler-is-called-from-interrupt-context kernel/sched.c --- a/kernel/sched.c~bug-if-setscheduler-is-called-from-interrupt-context +++ a/kernel/sched.c @@ -3894,6 +3894,8 @@ int sched_setscheduler(struct task_struc unsigned long flags; runqueue_t *rq; + /* may grab non-irq protected spin_locks */ + BUG_ON(in_interrupt()); recheck: /* double check policy once rq lock held */ if (policy < 0) _