Thread (5 messages) 5 messages, 3 authors, 2021-09-06

Re: [PATCH] KVM: stats: Add VM stat for remote tlb flush requests

From: Jing Zhang <hidden>
Date: 2021-08-18 16:15:55
Also in: kvmarm

Hi Marc,

On Wed, Aug 18, 2021 at 1:11 AM Marc Zyngier [off-list ref] wrote:
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
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"?
These two counters would have the same value for arm64, but not for
others (at least x86).
Thanks,

        M.

[1] https://lore.kernel.org/r/20210727103251.16561-1-pbonzini@redhat.com (local)

--
Without deviation from the norm, progress is not possible.
Thanks,
Jing
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help