* PATCH: Fix crash case
@ 2006-08-16 16:35 Alan Cox
2006-08-16 17:39 ` Jan Engelhardt
0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2006-08-16 16:35 UTC (permalink / raw)
To: akpm, linux-kernel
If we are going to BUG() not panic() here then we should cover the case
of the BUG being compiled out
Signed-off-by: Alan Cox <alan@redhat.com>
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc4-mm1/kernel/exit.c linux-2.6.18-rc4-mm1/kernel/exit.c
--- linux.vanilla-2.6.18-rc4-mm1/kernel/exit.c 2006-08-15 15:40:19.000000000 +0100
+++ linux-2.6.18-rc4-mm1/kernel/exit.c 2006-08-15 16:03:23.000000000 +0100
@@ -979,7 +979,8 @@
schedule();
BUG();
/* Avoid "noreturn function does return". */
- for (;;) ;
+ for (;;)
+ cpu_relax(); /* For when BUG is null */
}
EXPORT_SYMBOL_GPL(do_exit);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Fix crash case
2006-08-16 16:35 PATCH: Fix crash case Alan Cox
@ 2006-08-16 17:39 ` Jan Engelhardt
2006-08-16 19:10 ` Nick Warne
2006-08-18 9:51 ` Andi Kleen
0 siblings, 2 replies; 6+ messages in thread
From: Jan Engelhardt @ 2006-08-16 17:39 UTC (permalink / raw)
To: Alan Cox; +Cc: akpm, linux-kernel
>If we are going to BUG() not panic() here then we should cover the case
>of the BUG being compiled out
Bug can be compiled out? Ah well I much rather like this patch because of
the previous busy-looping, heating CPUs unnecessarily. (There was a thread,
about that, too.)
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Fix crash case
2006-08-16 17:39 ` Jan Engelhardt
@ 2006-08-16 19:10 ` Nick Warne
2006-08-16 19:15 ` Randy.Dunlap
2006-08-18 9:51 ` Andi Kleen
1 sibling, 1 reply; 6+ messages in thread
From: Nick Warne @ 2006-08-16 19:10 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Alan Cox, akpm, linux-kernel
Sorry for being a noob here - I read LKML to try to learn.
What is meant by 'If we are going to BUG()... cover the case
of the BUG being compiled out'.
What would make BUG(); not being compiled?
Nick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Fix crash case
2006-08-16 19:10 ` Nick Warne
@ 2006-08-16 19:15 ` Randy.Dunlap
2006-08-16 19:19 ` Nick Warne
0 siblings, 1 reply; 6+ messages in thread
From: Randy.Dunlap @ 2006-08-16 19:15 UTC (permalink / raw)
To: nick; +Cc: Jan Engelhardt, Alan Cox, akpm, linux-kernel
On Wed, 16 Aug 2006, Nick Warne wrote:
> Sorry for being a noob here - I read LKML to try to learn.
>
> What is meant by 'If we are going to BUG()... cover the case
> of the BUG being compiled out'.
>
> What would make BUG(); not being compiled?
It's a config option is EMBEDDED=y:
config BUG
bool "BUG() support" if EMBEDDED
default y
help
Disabling this option eliminates support for BUG and WARN, reducing
the size of your kernel image and potentially quietly ignoring
numerous fatal conditions. You should only consider disabling this
option for embedded systems with no facilities for reporting errors.
Just say Y.
--
~Randy
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: PATCH: Fix crash case
2006-08-16 19:15 ` Randy.Dunlap
@ 2006-08-16 19:19 ` Nick Warne
0 siblings, 0 replies; 6+ messages in thread
From: Nick Warne @ 2006-08-16 19:19 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: Jan Engelhardt, Alan Cox, akpm, linux-kernel
On Wednesday 16 August 2006 20:15, Randy.Dunlap wrote:
> > Sorry for being a noob here - I read LKML to try to learn.
> >
> > What is meant by 'If we are going to BUG()... cover the case
> > of the BUG being compiled out'.
> >
> > What would make BUG(); not being compiled?
>
> It's a config option is EMBEDDED=y:
>
Ah! That option. OK, thanks.
Nick
--
Every program has two purposes:
one for which it was written and another for which it wasn't.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Fix crash case
2006-08-16 17:39 ` Jan Engelhardt
2006-08-16 19:10 ` Nick Warne
@ 2006-08-18 9:51 ` Andi Kleen
1 sibling, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2006-08-18 9:51 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: akpm, linux-kernel, alan
Jan Engelhardt <jengelh@linux01.gwdg.de> writes:
> >If we are going to BUG() not panic() here then we should cover the case
> >of the BUG being compiled out
>
> Bug can be compiled out? Ah well I much rather like this patch because of
> the previous busy-looping, heating CPUs unnecessarily. (There was a thread,
> about that, too.)
cpu_relax() is on most CPUs as busy as a ";". This often annoys me
too (in particular in panic) when the CPU fans spin up and machines
become noisy. Maybe we need a portable halt() macro.
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-08-18 9:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-16 16:35 PATCH: Fix crash case Alan Cox
2006-08-16 17:39 ` Jan Engelhardt
2006-08-16 19:10 ` Nick Warne
2006-08-16 19:15 ` Randy.Dunlap
2006-08-16 19:19 ` Nick Warne
2006-08-18 9:51 ` Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox