Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755893Ab3JKU5J (ORCPT ); Fri, 11 Oct 2013 16:57:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47245 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755718Ab3JKU5G (ORCPT ); Fri, 11 Oct 2013 16:57:06 -0400 Date: Fri, 11 Oct 2013 13:57:04 -0700 From: Andrew Morton To: Roel Kluin Cc: Andrew Jones , Raghavendra K T , Konrad Rzeszutek Wilk , "H. Peter Anvin" , Ingo Molnar , LKML Subject: Re: [PATCH] jump_label: unlikely(x) > 0 Message-Id: <20131011135704.6fd455e2387a37f1972a4e0f@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1166 Lines: 36 On Fri, 11 Oct 2013 22:50:50 +0200 (CEST) Roel Kluin 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/