public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Steven Cole <elenstev@mesatop.com>,
	torvalds@transmeta.com, linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@digeo.com>, Ingo Molnar <mingo@elte.hu>,
	Steven Cole <scole@lanl.gov>
Subject: [PATCH] kernel BUG at sched.c:944! only with CONFIG_PREEMPT=y]
Date: 12 Sep 2002 16:35:13 -0400	[thread overview]
Message-ID: <1031862919.3770.103.camel@phantasy> (raw)
In-Reply-To: <1031862049.2799.402.camel@spc9.esa.lanl.gov>

On Thu, 2002-09-12 at 16:20, Steven Cole wrote:

> Yes.  Sorry, didn't catch this reply until now.
> I backed out Changeset 1.606 which Linus did to kernel/sched.c did this:
> 
> -       if (unlikely(in_interrupt()))
> +       if (unlikely(in_atomic()))
> 
> and 2.5.34-mm2 was able to boot with CONFIG_PREEMPT=y.
> 
> As I said in a response to myself on lkml, I know this isn't a fix,
> it just shows there is a problem somewhere with preempt.

No, there is not a problem in preempt... what this change does is BUG()
out if schedule() is called while being in any way non-atomic.

While this sounds like a great debugging check, it is not useful in
general since we surely have some bad code that calls schedule() with
locks held.  Further, since the atomic accounting only includes locks if
CONFIG_PREEMPT is set, you only see this with kernel preemption enabled.

Linus, please back this out... attached patch is against current BK.

Yeah, I know we can change the BUG() to a show_stack() ... but I still
think it will be too much and just deter people from using kernel
preemption which is the opposite of what I want.

	Robert Love

diff -urN linux-2.5.34/kernel/sched.c linux/kernel/sched.c
--- linux-2.5.34/kernel/sched.c	Thu Sep 12 16:26:23 2002
+++ linux/kernel/sched.c	Thu Sep 12 16:30:22 2002
@@ -940,8 +940,7 @@
 	struct list_head *queue;
 	int idx;
 
-	if (unlikely(in_atomic()))
-		BUG();
+	BUG_ON(in_interrupt());
 
 #if CONFIG_DEBUG_HIGHMEM
 	check_highmem_ptes();



       reply	other threads:[~2002-09-12 20:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3D80EF3F.D82B9CB9@digeo.com>
     [not found] ` <1031862049.2799.402.camel@spc9.esa.lanl.gov>
2002-09-12 20:35   ` Robert Love [this message]
2002-09-12 20:44     ` [PATCH] kernel BUG at sched.c:944! only with CONFIG_PREEMPT=y] Ingo Molnar
2002-09-12 20:45       ` Robert Love
2002-09-12 20:58         ` Steven Cole
2002-09-13  7:19         ` Ingo Molnar
2002-09-13  7:36           ` Robert Love
2002-09-13  7:40             ` Robert Love
2002-09-13 11:56               ` Thunder from the hill
2002-09-12 21:08       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1031862919.3770.103.camel@phantasy \
    --to=rml@tech9.net \
    --cc=akpm@digeo.com \
    --cc=elenstev@mesatop.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=scole@lanl.gov \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox