Re: [patch] mm, mempolicy: make mempolicies robust against errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 07 Mar 2012 01:34:16 -0500
KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxx> wrote:

> >> And, now BUG() has renreachable() annotation. why don't it work?
> >>
> >>
> >> #define BUG()                                                   \
> >> do {                                                            \
> >>          asm volatile("ud2");                                    \
> >>          unreachable();                                          \
> >> } while (0)
> >>
> >
> > That's not compiled for CONFIG_BUG=n; such a config fallsback to
> > include/asm-generic/bug.h which just does
> >
> > 	#define BUG()	do {} while (0)
> >
> > because CONFIG_BUG specifically _wants_ to bypass BUG()s and is reasonably
> > protected by CONFIG_EXPERT.
> 
> So, I strongly suggest to remove CONFIG_BUG=n. It is neglected very long time and
> much plenty code assume BUG() is not no-op. I don't think we can fix all place.
> 
> Just one instruction don't hurt code size nor performance.

Well yes, CONFIG_BUG=n is a crazy thing to do.  a) because programmers
universally assume that BUG() doesn't return and b) given that the
kernel KNOWS that it is about to fall off a cliff, why would anyone
want to deprive themselves of information about the forthcoming crash?

So perhaps a good compromise here is to do nothing: let the
CONFIG_BUG=n build spew a pile of warnings, and let the crazy
CONFIG_BUG=n people suffer.  That's if any such people exist...

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]