linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] BUG(): sched.c: Line 944
@ 2002-09-16 18:48 Robert Love
  2002-09-16 19:01 ` Linus Torvalds
  0 siblings, 1 reply; 34+ messages in thread
From: Robert Love @ 2002-09-16 18:48 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Linus,

The current in_atomic() check fails with kernel preemption enabled since
we set preempt_count to PREEMPT_ACTIVE in preempt_schedule().

We need to additionally check whether PREEMPT_ACTIVE is set.

There is also still the issue that bugging out is a bit drastic and a
hindrance to debugging; but I will tackle that later.  For now, please
apply this so we can at least boot with preemption enabled.

Patch is against 2.5.35-bk.

	Robert Love

diff -urN linux-2.5.35/kernel/sched.c linux/kernel/sched.c
--- linux-2.5.35/kernel/sched.c	Sun Sep 15 22:18:24 2002
+++ linux/kernel/sched.c	Mon Sep 16 14:43:54 2002
@@ -940,8 +940,7 @@
 	struct list_head *queue;
 	int idx;
 
-	if (unlikely(in_atomic()))
-		BUG();
+	BUG_ON(in_atomic() && preempt_count() != PREEMPT_ACTIVE);
 
 #if CONFIG_DEBUG_HIGHMEM
 	check_highmem_ptes();
@@ -959,7 +958,7 @@
 	 * if entering off of a kernel preemption go straight
 	 * to picking the next task.
 	 */
-	if (unlikely(preempt_count() & PREEMPT_ACTIVE))
+	if (unlikely(preempt_count() == PREEMPT_ACTIVE))
 		goto pick_next_task;
 
 	switch (prev->state) {


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2002-09-18 14:07 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-16 18:48 [PATCH] BUG(): sched.c: Line 944 Robert Love
2002-09-16 19:01 ` Linus Torvalds
2002-09-16 21:14   ` Robert Love
2002-09-16 21:41     ` Linus Torvalds
2002-09-16 22:15       ` Robert Love
2002-09-16 22:26         ` Linus Torvalds
2002-09-16 23:15           ` Robert Love
2002-09-16 23:45             ` Linus Torvalds
2002-09-16 23:58               ` Robert Love
2002-09-17  5:56                 ` Linus Torvalds
2002-09-17  8:12                   ` Robert Love
2002-09-17  8:51                     ` Robert Love
2002-09-17  8:59                     ` Robert Love
2002-09-17  9:57                       ` Ingo Molnar
2002-09-17 18:27                         ` Robert Love
2002-09-17 18:46                           ` Ingo Molnar
2002-09-17 14:10                       ` Steven Cole
2002-09-17 18:29                         ` Robert Love
2002-09-17 18:42                           ` Steven Cole
2002-09-17 15:27                       ` Linus Torvalds
2002-09-17 15:40                         ` Linus Torvalds
2002-09-17 15:53                           ` Ingo Molnar
2002-09-17 16:18                             ` Linus Torvalds
2002-09-17 16:26                               ` Ingo Molnar
2002-09-17 18:47                                 ` Robert Love
2002-09-17 18:57                                   ` Ingo Molnar
2002-09-17 19:23                                     ` Robert Love
2002-09-17 19:54                                       ` Steven Cole
2002-09-17 20:06                                         ` Robert Love
2002-09-17 20:32                                           ` Steven Cole
2002-09-17 20:58                                           ` Steven Cole
2002-09-18  4:44                                             ` Robert Love
2002-09-18 14:08                                               ` Steven Cole
2002-09-17 15:54                           ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).