mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: 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>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] jump_label: unlikely(x) > 0
Date: Fri, 11 Oct 2013 13:57:04 -0700	[thread overview]
Message-ID: <20131011135704.6fd455e2387a37f1972a4e0f@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1310112241220.11060@Z>

On Fri, 11 Oct 2013 22:50:50 +0200 (CEST) Roel Kluin <roel.kluin@gmail.com> wrote:

> untested, but wasn't this intended instead?
> --------------
> if (unlikely(x) > 0) doesn't seem to help branch prediction
> 
> ...
>
> --- 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;
>  }

I'm sure this was intended instead ;) The patch doesn't seem to make
any difference in code generation with my gcc.


  reply	other threads:[~2013-10-11 20:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 20:50 Roel Kluin
2013-10-11 20:57 ` Andrew Morton [this message]
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=20131011135704.6fd455e2387a37f1972a4e0f@linux-foundation.org \
    --to=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 \
    --cc=roel.kluin@gmail.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