Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 9fa336e3 authored by Paul Durrant's avatar Paul Durrant Committed by Sean Christopherson
Browse files

KVM: pfncache: check the need for invalidation under read lock first


When processing mmu_notifier invalidations for gpc caches, pre-check for
overlap with the invalidation event while holding gpc->lock for read, and
only take gpc->lock for write if the cache needs to be invalidated.  Doing
a pre-check without taking gpc->lock for write avoids unnecessarily
contending the lock for unrelated invalidations, which is very beneficial
for caches that are heavily used (but rarely subjected to mmu_notifier
invalidations).

Signed-off-by: default avatarPaul Durrant <pdurrant@amazon.com>
Reviewed-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
Link: https://lore.kernel.org/r/20240215152916.1158-20-paul@xen.org


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 615451d8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment