Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933257AbbGUPxp (ORCPT ); Tue, 21 Jul 2015 11:53:45 -0400 Received: from www.linutronix.de ([62.245.132.108]:34024 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932809AbbGUPxo (ORCPT ); Tue, 21 Jul 2015 11:53:44 -0400 Date: Tue, 21 Jul 2015 17:53:09 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Andy Lutomirski , Jason Baron , Mikulas Patocka , Paul Mackerras , Arnaldo Carvalho de Melo , Kees Cook , Andrea Arcangeli , Vince Weaver , "hillf.zj" , Valdis Kletnieks , "linux-kernel@vger.kernel.org" , Borislav Petkov , Steven Rostedt Subject: Re: Kernel broken on processors without performance counters In-Reply-To: <20150721154959.GS19282@twins.programming.kicks-ass.net> Message-ID: References: <20150708160750.GQ19282@twins.programming.kicks-ass.net> <559D8250.8000707@gmail.com> <20150710141359.GJ19282@twins.programming.kicks-ass.net> <20150721082107.GE18673@twins.programming.kicks-ass.net> <20150721154959.GS19282@twins.programming.kicks-ass.net> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1041 Lines: 32 On Tue, 21 Jul 2015, Peter Zijlstra wrote: > On Tue, Jul 21, 2015 at 05:43:27PM +0200, Thomas Gleixner wrote: > > > > +#define static_branch_inc(_k) static_key_slow_inc(&(_k)->key) > > > > +#define static_branch_dec(_k) static_key_slow_dec(&(_k)->key) > > > > Inlines please > > > > > > +/* > > > > + * Normal usage; boolean enable/disable. > > > > + */ > > > > + > > > > +#define static_branch_enable(_k) static_key_enable(&(_k)->key) > > > > +#define static_branch_disable(_k) static_key_disable(&(_k)->key) > > > > Ditto > > > > All in all much more understandable than the existing horror. > > They cannot in fact be inlines because we play type tricks. Note how _k > can be either struct static_likely_key or struct static_unlikely_key. Indeed. Care to add a comment? Thanks, tglx -- 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/