Messages in this thread | | | From | Andy Lutomirski <> | Date | Mon, 3 Aug 2015 21:07:53 -0700 | Subject | Re: [PATCH -v2 6/8] jump_label: Add a new static_key interface |
| |
On Mon, Aug 3, 2015 at 8:37 PM, Borislav Petkov <bp@alien8.de> 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
| |