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>