diff options
author | Sean Christopherson <[email protected]> | 2024-08-02 13:01:36 -0700 |
---|---|---|
committer | Sean Christopherson <[email protected]> | 2024-10-30 14:41:22 -0700 |
commit | 3e7f43188ee227bcf0f07f60a00f1fd1aca10e6a (patch) | |
tree | 2352d8d8028028066b4903e3c2b4dc2cce71952f /scripts/gdb/linux/stackdepot.py | |
parent | 6cf9ef23d9428ca4950a818e3e70bd818748815a (diff) |
KVM: Protect vCPU's "last run PID" with rwlock, not RCU
To avoid jitter on KVM_RUN due to synchronize_rcu(), use a rwlock instead
of RCU to protect vcpu->pid, a.k.a. the pid of the task last used to a
vCPU. When userspace is doing M:N scheduling of tasks to vCPUs, e.g. to
run SEV migration helper vCPUs during post-copy, the synchronize_rcu()
needed to change the PID associated with the vCPU can stall for hundreds
of milliseconds, which is problematic for latency sensitive post-copy
operations.
In the directed yield path, do not acquire the lock if it's contended,
i.e. if the associated PID is changing, as that means the vCPU's task is
already running.
Reported-by: Steve Rutherford <[email protected]>
Reviewed-by: Steve Rutherford <[email protected]>
Acked-by: Oliver Upton <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/stackdepot.py')
0 files changed, 0 insertions, 0 deletions