]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kvm: Note an RCU quiescent state on guest exit
authorLeonardo Bras <leobras@redhat.com>
Sat, 11 May 2024 02:05:56 +0000 (23:05 -0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 4 Sep 2024 14:44:42 +0000 (10:44 -0400)
commit593377036e50de89132bc1222800174fde0780ec
tree84cfe3462a8af2675378fe39427c479587cded1f
parentd30d9ee94cc0e7ae91da7251d9c280b8cf7e5e4d
kvm: Note an RCU quiescent state on guest exit

As of today, KVM notes a quiescent state only in guest entry, which is good
as it avoids the guest being interrupted for current RCU operations.

While the guest vcpu runs, it can be interrupted by a timer IRQ that will
check for any RCU operations waiting for this CPU. In case there are any of
such, it invokes rcu_core() in order to sched-out the current thread and
note a quiescent state.

This occasional schedule work will introduce tens of microsseconds of
latency, which is really bad for vcpus running latency-sensitive
applications, such as real-time workloads.

So, note a quiescent state in guest exit, so the interrupted guests is able
to deal with any pending RCU operations before being required to invoke
rcu_core(), and thus avoid the overhead of related scheduler work.

Signed-off-by: Leonardo Bras <leobras@redhat.com>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20240511020557.1198200-1-leobras@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/linux/context_tracking.h
include/linux/kvm_host.h