mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [BUG 2.6.20-rc2-mm1] init segfaults whenCONFIG_PROFILE_LIKELY=y
@ 2007-01-02 22:33 Hua Zhong
  0 siblings, 0 replies; only message in thread
From: Hua Zhong @ 2007-01-02 22:33 UTC (permalink / raw)
  To: fengguang.wu, akpm, linux-kernel, mingo, johnstul


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 */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-01-02 22:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-02 22:33 [BUG 2.6.20-rc2-mm1] init segfaults whenCONFIG_PROFILE_LIKELY=y Hua Zhong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®