[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250813143340.GN4067720@noisy.programming.kicks-ass.net>
Date: Wed, 13 Aug 2025 16:33:40 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Wangyang Guo <wangyang.guo@...el.com>
Cc: Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, Tianyou Li <tianyou.li@...el.com>,
Tim Chen <tim.c.chen@...ux.intel.com>
Subject: Re: [PATCH RESEND^2] x86/paravirt: add backoff mechanism to
virt_spin_lock
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.
Powered by blists - more mailing lists