mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Wangyang Guo <wangyang.guo@intel.com>
Cc: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Tianyou Li <tianyou.li@intel.com>,
	Tim Chen <tim.c.chen@linux.intel.com>
Subject: Re: [PATCH RESEND^2] x86/paravirt: add backoff mechanism to virt_spin_lock
Date: Wed, 13 Aug 2025 16:33:40 +0200	[thread overview]
Message-ID: <20250813143340.GN4067720@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250813005043.1528541-1-wangyang.guo@intel.com>

On Wed, Aug 13, 2025 at 08:50:43AM +0800, Wangyang Guo wrote:
> When multiple threads waiting for lock at the same time, once lock owner
> releases the lock, waiters will see lock available and all try to lock,
> which may cause an expensive CAS storm.
> 
> Binary exponential backoff is introduced. As try-lock attempt increases,
> there is more likely that a larger number threads compete for the same
> lock, so increase wait time in exponential.

You shouldn't be using virt_spin_lock() to begin with. That means you've
misconfigured your guest.

We have paravirt spinlocks for a reason.

  parent reply	other threads:[~2025-08-13 14:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13  0:50 Wangyang Guo
2025-08-13 14:23 ` Dave Hansen
2025-08-14  1:14   ` Guo, Wangyang
2025-08-13 14:33 ` Peter Zijlstra [this message]
2025-08-14  1:26   ` Guo, Wangyang
2025-08-14  3:10     ` [????] " Li,Rongqing
2025-08-14 10:41       ` Peter Zijlstra
2025-08-15  2:47         ` Guo, Wangyang
2025-08-14 10:39     ` Peter Zijlstra

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=20250813143340.GN4067720@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=tianyou.li@intel.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=vkuznets@redhat.com \
    --cc=wangyang.guo@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®