[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150721161215.GU19282@twins.programming.kicks-ass.net>
Date: Tue, 21 Jul 2015 18:12:15 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Andy Lutomirski <luto@...capital.net>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Jason Baron <jasonbaron0@...il.com>,
Mikulas Patocka <mpatocka@...hat.com>,
Paul Mackerras <paulus@...ba.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Kees Cook <keescook@...omium.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Vince Weaver <vince@...ter.net>,
"hillf.zj" <hillf.zj@...baba-inc.com>,
Valdis Kletnieks <Valdis.Kletnieks@...edu>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Borislav Petkov <bp@...en8.de>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: Kernel broken on processors without performance counters
On Tue, Jul 21, 2015 at 08:51:51AM -0700, Andy Lutomirski wrote:
> To clarify my (mis-)understanding:
>
> There are two degrees of freedom in a static_key. They can start out
> true or false, and they can be unlikely or likely. Are those two
> degrees of freedom in fact tied together?
Yes, if you start out false, you must be unlikely. If you start out
true, you must be likely.
We could maybe try and untangle that if there really is a good use case,
but this is the current state.
The whole reason this happened is because 'false' is like:
...
<nop>
1:
...
label:
<unlikely code>
jmp 1b
Where the code if out-of-line by default. The enable will rewrite the
<nop> with a jmp label.
Of course, if you have code that is on by default, you don't want to pay
that out-of-line penalty all the time. So the on by default generates:
...
<nop>
<likely code>
label:
...
Where, if we disable, we replace the nop with jmp label.
Or rather, that all is the intent, GCC doesn't actually honour hot/cold
attributes on asm labels very well last time I tried.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists