[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0701021421290.2074@localhost.localdomain>
Date: Tue, 2 Jan 2007 14:33:08 -0800 (PST)
From: Hua Zhong <hzhong@...il.com>
To: fengguang.wu@...il.com, akpm@...l.org,
linux-kernel@...r.kernel.org, mingo@...e.hu, johnstul@...ibm.com
Subject: Re: [BUG 2.6.20-rc2-mm1] init segfaults whenCONFIG_PROFILE_LIKELY=y
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@...il.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists