From: Hua Zhong <hzhong@gmail.com>
To: fengguang.wu@gmail.com, akpm@osdl.org,
linux-kernel@vger.kernel.org, mingo@elte.hu, johnstul@us.ibm.com
Subject: Re: [BUG 2.6.20-rc2-mm1] init segfaults whenCONFIG_PROFILE_LIKELY=y
Date: Tue, 2 Jan 2007 14:33:08 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0701021421290.2074@localhost.localdomain> (raw)
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 */
reply other threads:[~2007-01-02 22:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0701021421290.2074@localhost.localdomain \
--to=hzhong@gmail.com \
--cc=akpm@osdl.org \
--cc=fengguang.wu@gmail.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®