Messages in this thread Patch in this message | | | Date | Tue, 2 Jan 2007 14:33:08 -0800 (PST) | Subject | Re: [BUG 2.6.20-rc2-mm1] init segfaults whenCONFIG_PROFILE_LIKELY=y | From | Hua Zhong <> |
| |
I am wondering if we should define __likely/__unlikely macros no matter whether CONFIG_LIKELY_PROFILE is defined, like the following. This way people can always use the raw macros in case the debugging version causes problems.
Signed-off-by: Hua Zhong <hzhong@gmail.com>
--- linux-2.6/include/linux/compiler.h.orig 2007-01-02 13:51:32.000000000 -0800 +++ linux-2.6/include/linux/compiler.h 2007-01-02 14:18:33.000000000 -0800 @@ -53,6 +53,9 @@ # include <linux/compiler-intel.h> #endif +#define __likely(x) __builtin_expect(!!(x), 1) +#define __unlikely(x) __builtin_expect(!!(x), 0) + #if defined(CONFIG_PROFILE_LIKELY) && !(defined(CONFIG_MODULE_UNLOAD) && defined(MODULE)) struct likeliness { const char *func; @@ -93,8 +96,8 @@ * specific implementations come from the above header files */ -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) +#define likely(x) __likely(x) +#define unlikely(x) __unlikely(x) #endif /* Optimization barrier */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |