[PATCH -mm] bug if setscheduler is called from interrupt context.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

-- Steve

Signed-off-by: Steven Rostedt <[email protected]>

Index: linux-2.6.17-mm1/kernel/sched.c
===================================================================
--- linux-2.6.17-mm1.orig/kernel/sched.c	2006-06-23 05:19:41.000000000 -0400
+++ linux-2.6.17-mm1/kernel/sched.c	2006-06-23 05:20:44.000000000 -0400
@@ -4034,6 +4034,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)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux