Re: [RFC PATCH] Flipped jump labels

2014-08-11 Thread Borislav Petkov
On Sun, Aug 10, 2014 at 11:32:31PM -0400, Jason Baron wrote: > That is correct. We don't currently support having the default > branch direction or the fast path be different from how the > 'static_key' is initialized. > > If I understand your use-case correctly, you can't have the tsc > path be

Re: [RFC PATCH] Flipped jump labels

2014-08-10 Thread Jason Baron
On 08/10/2014 12:07 PM, Borislav Petkov wrote: > On Sun, Aug 10, 2014 at 05:45:15PM +0200, Ingo Molnar wrote: >> Indeed - but could we use that interface to cleanly expose the >> arch_static_branch_active() code you've written, or do we need new >> variants? > We could probably. > > The thing is, i

Re: [RFC PATCH] Flipped jump labels

2014-08-10 Thread Borislav Petkov
On Sun, Aug 10, 2014 at 05:45:15PM +0200, Ingo Molnar wrote: > Indeed - but could we use that interface to cleanly expose the > arch_static_branch_active() code you've written, or do we need new > variants? We could probably. The thing is, if we want to do the _active thing, the whole jump labels

Re: [RFC PATCH] Flipped jump labels

2014-08-10 Thread Ingo Molnar
* Borislav Petkov wrote: > On Sun, Aug 10, 2014 at 08:13:03AM +0200, Ingo Molnar wrote: > > Wouldn't using STATIC_KEY_INIT_TRUE and static_key_true() [instead of > > !static_key_false()] result in the same good code placement effects? > > Nope, not really. static_key_true() is !static_key_false

Re: [RFC PATCH] Flipped jump labels

2014-08-10 Thread Borislav Petkov
On Sun, Aug 10, 2014 at 08:13:03AM +0200, Ingo Molnar wrote: > Wouldn't using STATIC_KEY_INIT_TRUE and static_key_true() [instead of > !static_key_false()] result in the same good code placement effects? Nope, not really. static_key_true() is !static_key_false() and we're not changing anything, lo

Re: [RFC PATCH] Flipped jump labels

2014-08-09 Thread Ingo Molnar
[same mail, with Jason's email address corrected.] * Ingo Molnar wrote: > * Borislav Petkov wrote: > > > Hi dudes, > > > > with the current impl. of jump labels, people can't really do the > > following: > > > > --- > > JMP unlikely_code > > likely_code > > > > unlikely_code: > > unlikely

Re: [RFC PATCH] Flipped jump labels

2014-08-09 Thread Ingo Molnar
* Borislav Petkov wrote: > Hi dudes, > > with the current impl. of jump labels, people can't really do the > following: > > --- > JMP unlikely_code > likely_code > > unlikely_code: > unlikely code > --- > > and after some initialization queries overwrite the JMP with a NOP so > that the like

[RFC PATCH] Flipped jump labels

2014-08-09 Thread Borislav Petkov
Hi dudes, with the current impl. of jump labels, people can't really do the following: --- JMP unlikely_code likely_code unlikely_code: unlikely code --- and after some initialization queries overwrite the JMP with a NOP so that the likely code gets executed at 0 cost. The issue is that jump l