The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Guo Hui <guohui@uniontech.com>, peterz@infradead.org
Cc: jgross@suse.com, srivatsa@csail.mit.edu, amakhalov@vmware.com,
	pv-drivers@vmware.com, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
	hpa@zytor.com, will@kernel.org, boqun.feng@gmail.com,
	virtualization@lists.linux-foundation.org,
	wangxiaohua@uniontech.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/paravirt: useless assignment instructions cause Unixbench full core performance degradation
Date: Mon, 27 Jun 2022 09:25:54 -0400	[thread overview]
Message-ID: <14a3278e-0299-8138-ff73-654d0208bdfa@redhat.com> (raw)
In-Reply-To: <62b94621.1c69fb81.3a378.57ccSMTPIN_ADDED_BROKEN@mx.google.com>

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


  parent reply	other threads:[~2022-06-27 13:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 15:50 [PATCH] x86/paravirt: useless assignment instructions cause Unixbench full core performance degradation Guo Hui
2022-06-23 21:54 ` Waiman Long
2022-06-27  2:13   ` [PATCH v2] " Guo Hui
2022-06-27  3:02     ` Waiman Long
     [not found]       ` <62b94621.1c69fb81.3a378.57ccSMTPIN_ADDED_BROKEN@mx.google.com>
2022-06-27 13:25         ` Waiman Long [this message]
2022-06-27  5:57     ` Juergen Gross
2022-06-27  7:07       ` [PATCH v3] " Guo Hui
2022-06-27  7:49     ` [PATCH v2] " Peter Zijlstra
     [not found]       ` <3c020577-2045-fa12-9e33-65ece10bda30@uniontech.com>
2022-06-27  9:30         ` Peter Zijlstra
2022-06-27 14:27       ` [PATCH v4] " Guo Hui
2022-06-27 15:42         ` Juergen Gross
2022-06-27 15:58         ` Waiman Long
2022-06-28  4:31           ` [PATCH v5] " Guo Hui
2022-06-28 12:54           ` [PATCH v6] " Guo Hui
2022-06-28 14:15             ` Waiman Long
2022-06-28 16:12               ` [PATCH v7] " Guo Hui
2022-06-28 17:28                 ` 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=14a3278e-0299-8138-ff73-654d0208bdfa@redhat.com \
    --to=longman@redhat.com \
    --cc=amakhalov@vmware.com \
    --cc=boqun.feng@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=guohui@uniontech.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pv-drivers@vmware.com \
    --cc=srivatsa@csail.mit.edu \
    --cc=tglx@linutronix.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wangxiaohua@uniontech.com \
    --cc=will@kernel.org \
    --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