Skip to content

KVM: Protect vCPU's PID with a rwlock

Sean Christopherson kvm kvmarm linux-arm-kernel lkml 1 version Applied

Status from this message: Applied to kvm-x86 generic, with a comment explaining the vcpu->mutex is the

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: Return '0' directly when there's no task to yield tovirt/kvm/kvm_main.c+2 -20 replies
2/2KVM: Protect vCPU's "last run PID" with rwlock, not RCUarch/arm64/include/asm/kvm_host.h include/linux/kvm_host.h virt/kvm/kvm_main.c+21 -167 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSteve RutherfordOliver Upton
SeriesA-b
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: Protect vCPU's PID with a rwlock

Protect vcpu->pid with a rwlock instead of RCU, so that running a vCPU with a different task doesn't require a full RCU synchronization, which can introduce a non-trivial amount of jitter, especially on large systems.

I've had this mini-series sitting around for ~2 years, pretty much as-is. I could have sworn past me thought there was a flaw in using a rwlock, and so I never posted it, but for the life of me I can't think of any issues.

Extra eyeballs would be much appreciated.

Sean Christopherson (2):
KVM: Return '0' directly when there's no task to yield to
KVM: Protect vCPU's "last run PID" with rwlock, not RCU

 arch/arm64/include/asm/kvm_host.h |  2 +-
 include/linux/kvm_host.h          |  3 ++-
 virt/kvm/kvm_main.c               | 36 +++++++++++++++++--------------
 3 files changed, 23 insertions(+), 18 deletions(-)

base-commit: 332d2c1d713e232e163386c35a3ba0c1b90df83f

Signature · 1 line
2.46.0.rc2.264.g509ed76dc8-goog