Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbbHDEIQ (ORCPT ); Tue, 4 Aug 2015 00:08:16 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:34276 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbbHDEIP (ORCPT ); Tue, 4 Aug 2015 00:08:15 -0400 MIME-Version: 1.0 In-Reply-To: <20150804033733.GB31787@nazgul.tnic> References: <20150728132055.203176565@infradead.org> <20150728132313.164884020@infradead.org> <55B87E7A.2070509@suse.cz> <20150729084906.GH19282@twins.programming.kicks-ass.net> <20150803150359.0e76b576@gandalf.local.home> <20150803191816.GC25159@twins.programming.kicks-ass.net> <20150803152810.5a7bcf06@gandalf.local.home> <20150803200002.GE25159@twins.programming.kicks-ass.net> <20150803175757.2adf3275@gandalf.local.home> <20150804033733.GB31787@nazgul.tnic> From: Andy Lutomirski Date: Mon, 3 Aug 2015 21:07:53 -0700 Message-ID: Subject: Re: [PATCH -v2 6/8] jump_label: Add a new static_key interface To: Borislav Petkov Cc: Steven Rostedt , Peter Zijlstra , Vlastimil Babka , "linux-kernel@vger.kernel.org" , Ingo Molnar , Jason Baron , Thomas Gleixner , Will Deacon , liuj97@gmail.com, rabin@rab.in, Ralf Baechle , David Daney , Benjamin Herrenschmidt , michael@ellerman.id.au, Heiko Carstens , "David S. Miller" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1193 Lines: 30 On Mon, Aug 3, 2015 at 8:37 PM, Borislav Petkov wrote: > On Mon, Aug 03, 2015 at 05:57:57PM -0400, Steven Rostedt wrote: >> That's implementation details, not a general concept that users will >> need to know about. > > Why? > > It is a branch, regardless of which insn is used on which arch - it is > either active and you *branch* to that code or *inactive* and you don't. > So now it is actually what it should've been from the beginning... Except that, with the new interface, static_key_likely is the other way around, right? If the key is true (i.e. enabled), then it doesn't branch. I think of the key as a boolean thing that happens to work by code patching under the hood. The fancy patching affects the performance but doesn't really make it functionally different from a regular variable. How about making it extra explicit: static_key_set(&key, value); where value is a bool or maybe even an unsigned int? --Andy -- 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/