lkml.org 
[lkml]   [2019]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] KVM: Disable wake-affine vCPU process to mitigate lock holder preemption
From
Date
On Tue, 2019-07-30 at 13:46 +0200, Paolo Bonzini wrote:
> On 30/07/19 11:33, Wanpeng Li wrote:
> > When qemu/other vCPU inject virtual interrupt to guest through
> > waking up one
> > sleeping vCPU, it increases the probability to stack vCPUs/qemu by
> > scheduler
> > wake-affine. vCPU stacking issue can greately inceases the lock
> > synchronization
> > latency in a virtualized environment. This patch disables wake-
> > affine vCPU
> > process to mitigtate lock holder preemption.
>
> There is no guarantee that the vCPU remains on the thread where it's
> created, so the patch is not enough.
>
> If many vCPUs are stacked on the same pCPU, why doesn't the wake_cap
> kick in sooner or later?
>
Assuming it actually is the case that vcpus *do* get stacked *and* that
wake_cap() *doesn't* kick in, maybe it could be because of this check?

/* Minimum capacity is close to max, no need to abort wake_affine */
if (max_cap - min_cap < max_cap >> 3)
return 0;

Regards
--
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-08-01 14:40    [W:0.224 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site