lkml.org 
[lkml]   [2018]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] x86/speculation: switch_to_cond_stibp on is the likely case
From
Date
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

\
 
 \ /
  Last update: 2018-12-06 16:39    [W:0.078 / U:0.296 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site