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 <[email protected]>
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);
>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
--
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
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
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.
Jan Engelhardt <[email protected]> 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