summaryrefslogtreecommitdiff
path: root/drivers/macintosh/adb-iop.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2024-08-02 13:01:36 -0700
committerSean Christopherson <seanjc@google.com>2024-10-30 14:41:22 -0700
commit3e7f43188ee227bcf0f07f60a00f1fd1aca10e6a (patch)
tree2352d8d8028028066b4903e3c2b4dc2cce71952f /drivers/macintosh/adb-iop.c
parent6cf9ef23d9428ca4950a818e3e70bd818748815a (diff)
downloadlinux-3e7f43188ee227bcf0f07f60a00f1fd1aca10e6a.tar.gz
linux-3e7f43188ee227bcf0f07f60a00f1fd1aca10e6a.tar.bz2
linux-3e7f43188ee227bcf0f07f60a00f1fd1aca10e6a.zip
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 <srutherford@google.com> Reviewed-by: Steve Rutherford <srutherford@google.com> Acked-by: Oliver Upton <oliver.upton@linux.dev> Link: https://lore.kernel.org/r/20240802200136.329973-3-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'drivers/macintosh/adb-iop.c')
0 files changed, 0 insertions, 0 deletions