From: Roel Kluin <roel.kluin@gmail.com>
To: Andrew Jones <drjones@redhat.com>,
Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
"H. Peter Anvin" <hpa@linux.intel.com>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] jump_label: unlikely(x) > 0
Date: Fri, 11 Oct 2013 22:50:50 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.02.1310112241220.11060@Z> (raw)
untested, but wasn't this intended instead?
--------------
if (unlikely(x) > 0) doesn't seem to help branch prediction
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index a507907..cf08540 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -132,14 +132,14 @@ static __always_inline void jump_label_init(void)
static __always_inline bool static_key_false(struct static_key *key)
{
- if (unlikely(atomic_read(&key->enabled)) > 0)
+ if (unlikely(atomic_read(&key->enabled) > 0))
return true;
return false;
}
static __always_inline bool static_key_true(struct static_key *key)
{
- if (likely(atomic_read(&key->enabled)) > 0)
+ if (likely(atomic_read(&key->enabled) > 0))
return true;
return false;
}
next reply other threads:[~2013-10-11 20:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 20:50 Roel Kluin [this message]
2013-10-11 20:57 ` Andrew Morton
2013-10-15 16:53 ` H. Peter Anvin
2013-10-16 6:46 ` Ingo Molnar
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=alpine.DEB.2.02.1310112241220.11060@Z \
--to=roel.kluin@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=drjones@redhat.com \
--cc=hpa@linux.intel.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=raghavendra.kt@linux.vnet.ibm.com \
/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
Powered by JetHome