lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 27 Jun 2022 09:25:54 -0400
From:   Waiman Long <longman@...hat.com>
To:     Guo Hui <guohui@...ontech.com>, peterz@...radead.org
Cc:     jgross@...e.com, srivatsa@...il.mit.edu, amakhalov@...are.com,
        pv-drivers@...are.com, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
        hpa@...or.com, will@...nel.org, boqun.feng@...il.com,
        virtualization@...ts.linux-foundation.org,
        wangxiaohua@...ontech.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] x86/paravirt: useless assignment instructions cause
 Unixbench full core performance degradation

On 6/27/22 01:54, Guo Hui wrote:
> Thank you very much Longman, my patch is as you said, only disable 
> node_cpu on X86, enable node_cpu on arm64, powerpc, s390 architectures;
> the code is in file arch/x86/kernel/paravirt-spinlocks.c:
>     DECLARE_STATIC_KEY_FALSE(preemted_key);
>     static_branch_enable(&preemted_key);
>
> the default value of preemted_key is false and the if conditional 
> statement is reversed,
> the code is in file kernel/locking/osq_lock.c:
>     DEFINE_STATIC_KEY_FALSE(preemted_key);
>
>     static inline int node_cpu(struct optimistic_spin_node *node)
>     {
>         int cpu = 0;
>
>         if (!static_branch_unlikely(&preemted_key))
>             cpu = node->cpu - 1;
>
>         return cpu;
>   }
>
> In this way, only one nop instruction is added to architectures arm64, 
> powerpc and s390, including virtual machines, without any other changes.

You are right. I am probably too tired last night to read the patch more 
carefully.

Cheers,
Longman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ