public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: torvalds@transmeta.com
Cc: "Adam J. Richter" <adam@yggdrasil.com>,
	linux-kernel@vger.kernel.org, Robert Love <rml@tech9.net>
Subject: Re: Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() at boot time
Date: Thu, 04 Apr 2002 10:28:02 -0800	[thread overview]
Message-ID: <3CAC9B32.2050000@us.ibm.com> (raw)
In-Reply-To: <20020404035910.A281@baldur.yggdrasil.com> <3CAC7E15.203@us.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

David C. Hansen wrote:
> Adam J. Richter wrote:
>> The was a small change to to kernel/exit.c
>> in 2.5.8-pre1 which deleted a kernel_lock() call.  Restoring that line
>> resulted in a kernel that booted fine.
>>
> I take it you don't have a copy of the BUG().   I was going to ask if 
> preemption was enabled, but I see that it was from another message.  I 
> was guessing that preemption contributed to this, but now I know.  The 
> lock_kernel() has 2 different effects here.  It locks the kernel_flag, 
> AND it disables preemption.  The correct fix here will probably be to 
> disable preemption, rather than readd the lock_kernel(). 

I've replicated the problem too.
I've diabled preemption in the area where it used to be disabled because 
of the old lock_kernel().  I'm sending this message from a machine with 
that patch applied, so the patch does fix it.  As the comment says, this 
is something that the preempt experts need to take a look at.
Linus, this is a hack, and there is probably still a window where 
preemption can happen.  But, it is a band-aid until we find the real 
problem.


-- 
Dave Hansen
haveblue@us.ibm.com

[-- Attachment #2: do_exit-add_preempt_disable.2.5.8-pre1.patch --]
[-- Type: text/plain, Size: 633 bytes --]

--- linux-2.5.8-pre1-clean/kernel/exit.c	Thu Apr  4 08:58:31 2002
+++ linux/kernel/exit.c	Thu Apr  4 10:19:37 2002
@@ -499,6 +499,11 @@
 	acct_process(code);
 	__exit_mm(tsk);
 
+	/* I removed the lock_kernel() from here.  It caused preempt kernels
+	   to oops.  This fixes it for now, but the real cause needs to 
+	   be found.  
+           - Dave Hansen <haveblue@us.ibm.com> 04-04-2002 */
+	preempt_disable();
 	sem_exit();
 	__exit_files(tsk);
 	__exit_fs(tsk);
@@ -515,6 +520,7 @@
 
 	tsk->exit_code = code;
 	exit_notify();
+	preempt_enable_no_resched(); /* partner of above preempt_disable(); */
 	schedule();
 	BUG();
 /*

  reply	other threads:[~2002-04-04 18:28 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-04 11:59 Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() at boot time Adam J. Richter
2002-04-04 12:56 ` Stelian Pop
2002-04-04 13:40   ` Alessandro Suardi
2002-04-04 16:23 ` David C. Hansen
2002-04-04 18:28   ` Dave Hansen [this message]
2002-04-04 18:51     ` Robert Love
2002-04-04 19:14       ` Linus Torvalds
2002-04-04 19:26         ` Robert Love
2002-04-04 19:41           ` Dave Hansen
2002-04-04 20:02             ` Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() atboot time george anzinger
2002-04-04 20:54           ` Andrew Morton
2002-04-04 21:34           ` Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() at boot time Roger Larsson
2002-04-04 22:38             ` Andrew Morton
2002-04-04 22:42               ` Linus Torvalds
2002-04-04 22:54                 ` Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() atboot time Andrew Morton
2002-04-04 23:07                 ` Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() at boot time Robert Love
2002-04-04 23:42                   ` Linus Torvalds
2002-04-04 23:47                     ` Robert Love
2002-04-04 23:55                       ` Linus Torvalds
2002-04-05  0:03                         ` [PATCH] preemptive kernel behavior change: don't be rude Robert Love
2002-04-05  1:51                           ` george anzinger
2002-04-05  2:06                             ` Robert Love
2002-04-04 22:55               ` Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() at boot time Robert Love
2002-04-04 23:10                 ` Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() atboot time Andrew Morton
2002-04-04 23:16                   ` Robert Love
2002-04-04 19:13     ` Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() at boot time Linus Torvalds
2002-04-04 19:16       ` Robert Love
2002-04-04 19:45         ` Linus Torvalds
2002-04-04 20:09           ` Patch: linux-2.5.8-pre1/kernel/exit.c change caused BUG() atboot time george anzinger
2002-04-04 19:48       ` george anzinger

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=3CAC9B32.2050000@us.ibm.com \
    --to=haveblue@us.ibm.com \
    --cc=adam@yggdrasil.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@tech9.net \
    --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