Skip to content

RFC srcu: KVM: Add, export and use call_srcu_expedited()

Sean Christopherson kvm lkml rcu 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3srcu: Declare exported symbols before including srcu{tiny,tree}.hinclude/linux/srcu.h include/linux/srcutiny.h+5 -70 replies
2/3srcu: Add and export call_srcu_expedited() to avoid transferring grace periodsinclude/linux/srcutiny.h include/linux/srcutree.h kernel/rcu/srcutree.c+15 -00 replies
3/3KVM: Expedite SRCU callbacks when freeing objects during I/O bus registrationvirt/kvm/kvm_main.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] srcu: KVM: Add, export and use call_srcu_expedited()

We've got a conundrum in KVM where we have multiple use cases that generally want the same thing (eliminate waiting on guest configuration changes whenever possible), but use KVM uAPIs in slightly different ways and effectively create competing requirements.

The crux of the problem is that one use case wants KVM to free an object via call_srcu() so that the task doesn't risk getting stalled waiting for a grace period. But for the other use case, using call_srcu() can trigger a non-expedited grace period and cause a synchronize_srcu_expedited() in a different ioctl (that must do a full sync, i.e. can't use call_srcu()) to stall waiting for the non-expedited grace period.

Tagged RFC because while having the call_srcu() request do an expedited grace period eliminates the unwanted synchronize_srcu_expedited() stalls, this feels
like a very crude fix. That said, I'm definitely not opposed to this being a
final solution if it's the best option available.

Sean Christopherson (3):
srcu: Declare exported symbols before including srcu{tiny,tree}.h
srcu: Add and export call_srcu_expedited() to avoid transferring grace
periods
KVM: Expedite SRCU callbacks when freeing objects during I/O bus
registration

 include/linux/srcu.h     | 10 +++++-----
 include/linux/srcutiny.h |  8 ++++++--
 include/linux/srcutree.h |  2 ++
 kernel/rcu/srcutree.c    |  7 +++++++
 virt/kvm/kvm_main.c      |  2 +-
 5 files changed, 21 insertions(+), 8 deletions(-)

base-commit: 5128b972fb2801ad9aca54d990a75611ab5283a9

Signature · 1 line
2.53.0.473.g4a7958ca14-goog