aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2006-06-27 05:54:44 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-27 20:32:46 -0400
commit66e5393a78b3fcca63e7748e38221dcca61c4aab (patch)
tree57c5408e8e5596863f4abbe1c822bb0c1c7ff059 /kernel/sched.c
parent9fea80e4d984d411aa188baa31225c273ebe0fe6 (diff)
[PATCH] BUG() if setscheduler is called from interrupt context
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 <aka. Andrew Morton> for this suggestion). Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 19c0d5d16fef..15abf0833245 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3862,6 +3862,8 @@ int sched_setscheduler(struct task_struct *p, int policy,
3862 unsigned long flags; 3862 unsigned long flags;
3863 runqueue_t *rq; 3863 runqueue_t *rq;
3864 3864
3865 /* may grab non-irq protected spin_locks */
3866 BUG_ON(in_interrupt());
3865recheck: 3867recheck:
3866 /* double check policy once rq lock held */ 3868 /* double check policy once rq lock held */
3867 if (policy < 0) 3869 if (policy < 0)