From: Waiman Long <longman@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Tim Chen <tim.c.chen@linux.intel.com>,
Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [PATCH 2/2] x86/speculation: switch_to_cond_stibp on is the likely case
Date: Thu, 6 Dec 2018 10:38:00 -0500 [thread overview]
Message-ID: <3732de84-a14f-e32a-61de-29c5965dd405@redhat.com> (raw)
In-Reply-To: <20181206084141.GA13538@hirez.programming.kicks-ass.net>
On 12/06/2018 03:41 AM, Peter Zijlstra wrote:
> On Wed, Dec 05, 2018 at 02:49:28PM -0500, Waiman Long wrote:
>> Since conditional STIBP is the default, it should be treated as
>> the likely case. Changes the use of static_branch_unlikely() to
>> static_branch_likely() for switch_to_cond_stibp.
> So now you're making kernels on 'fixed' or unaffected hardware slower.
Good point.
The reason I sent out this patch is because of the inconsistency in the
use of likely/unlikely hints.
arch/x86/kernel/cpu/bugs.c:156: if
(static_branch_unlikely(&switch_to_cond_stibp))
arch/x86/kernel/process.c:440:
static_branch_unlikely(&switch_to_cond_stibp)) {
arch/x86/kernel/process.h:26: if
(!static_branch_likely(&switch_to_cond_stibp)) {
So if we are aiming to optimize for "fixed" or unaffected hardware,
maybe we should modify the likely hint to unlikely then.
Cheers,
Longman
next prev parent reply other threads:[~2018-12-06 15:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 19:49 [PATCH 1/2] x86/speculation: Change STIPB to STIBP Waiman Long
2018-12-05 19:49 ` [PATCH 2/2] x86/speculation: switch_to_cond_stibp on is the likely case Waiman Long
2018-12-06 8:41 ` Peter Zijlstra
2018-12-06 15:38 ` Waiman Long [this message]
2018-12-07 8:52 ` Peter Zijlstra
2018-12-07 9:33 ` Thomas Gleixner
2018-12-06 11:06 ` [tip:x86/pti] x86/speculation: Change misspelled STIPB to STIBP tip-bot for Waiman Long
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3732de84-a14f-e32a-61de-29c5965dd405@redhat.com \
--to=longman@redhat.com \
--cc=bp@alien8.de \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®