lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20131011135704.6fd455e2387a37f1972a4e0f@linux-foundation.org>
Date:	Fri, 11 Oct 2013 13:57:04 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Roel Kluin <roel.kluin@...il.com>
Cc:	Andrew Jones <drjones@...hat.com>,
	Raghavendra K T <raghavendra.kt@...ux.vnet.ibm.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Ingo Molnar <mingo@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] jump_label: unlikely(x) > 0

On Fri, 11 Oct 2013 22:50:50 +0200 (CEST) Roel Kluin <roel.kluin@...il.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.

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ