[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150723145801.GI25159@twins.programming.kicks-ass.net>
Date: Thu, 23 Jul 2015 16:58:01 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Jason Baron <jasonbaron0@...il.com>
Cc: Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...capital.net>,
Thomas Gleixner <tglx@...utronix.de>,
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>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: Kernel broken on processors without performance counters
On Thu, Jul 23, 2015 at 10:19:52AM -0400, Jason Baron wrote:
> >
> > #define static_branch_likely(x) \
> > ({ \
> > bool branch; \
> > if (__builtin_types_compatible_p(typeof(x), struct static_key_true)) \
> > branch = !arch_static_branch(&(x)->key, false); \
> > else if (__builtin_types_compatible_p(typeof(x), struct static_key_false)) \
> > branch = !arch_static_branch_jump(&(x)->key, true); \
> > else \
> > branch = ____wrong_branch_error(); \
> > branch; \
> > })
> >
> > #define static_branch_unlikely(x) \
> > ({ \
> > bool branch; \
> > if (__builtin_types_compatible_p(typeof(x), struct static_key_true)) \
> > branch = arch_static_branch(&(x)->key, true); \
> > else if (__builtin_types_compatible_p(typeof(x), struct static_key_false)) \
> > branch = arch_static_branch_jump(&(x)->key, false); \
> > else \
> > branch = ____wrong_branch_error(); \
> > branch; \
> > })
> >
>
> In 'static_branch_unlikely()', I think arch_static_branch() and
> arch_static_branch_jump() are reversed.
Yes, you're right. But I think I need a nap before touching this stuff
again :-)
--
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