Re: [PATCH] KVM: stats: Add VM stat for remote tlb flush requests
From: Marc Zyngier <maz@kernel.org>
Date: 2021-08-18 16:52:26
Also in:
kvmarm
On Wed, 18 Aug 2021 17:15:36 +0100, Jing Zhang [off-list ref] wrote:
Hi Marc, On Wed, Aug 18, 2021 at 1:11 AM Marc Zyngier [off-list ref] wrote:quoted
On Tue, 17 Aug 2021 01:26:39 +0100, Jing Zhang [off-list ref] wrote:quoted
Add a new stat that counts the number of times a remote TLB flush is requested, regardless of whether it kicks vCPUs out of guest mode. This allows us to look at how often flushes are initiated.nit: this is a very x86-centric view of things. On arm64, TLB invalidation is broadcast in HW, and does not interrupt the guest execution.Understood. Thanks.quoted
quoted
Original-by: David Matlack [off-list ref] Signed-off-by: Jing Zhang <redacted> --- arch/arm64/kvm/mmu.c | 1 + include/linux/kvm_host.h | 3 ++- include/linux/kvm_types.h | 1 + virt/kvm/kvm_main.c | 1 + 4 files changed, 5 insertions(+), 1 deletion(-)diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index 0625bf2353c2..f5bb235bbb59 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c@@ -80,6 +80,7 @@ static bool memslot_is_logging(struct kvm_memory_slot *memslot) */ void kvm_flush_remote_tlbs(struct kvm *kvm) { + ++kvm->stat.generic.remote_tlb_flush_requests; kvm_call_hyp(__kvm_tlb_flush_vmid, &kvm->arch.mmu); }We already have this queued for 5.15 [1].I guess you mean the change for "remote_tlb_flush" has been queued, not "remote_tlb_flush_requests"?
Yes, this is what I meant, as I only quoted the bit that was redundant.
These two counters would have the same value for arm64, but not for others (at least x86).
Sure. It is just that this patch does two things at once, but doesn't advertise it. Thanks, M. -- Without deviation from the norm, progress is not possible.