All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Jing Zhang <jingzhangos@google.com>
Cc: KVM <kvm@vger.kernel.org>, Peter Shier <pshier@google.com>,
	David Matlack <dmatlack@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	KVMARM <kvmarm@lists.cs.columbia.edu>
Subject: Re: [PATCH] KVM: stats: Add VM stat for remote tlb flush requests
Date: Wed, 18 Aug 2021 09:11:45 +0100	[thread overview]
Message-ID: <87v943rx32.wl-maz@kernel.org> (raw)
In-Reply-To: <20210817002639.3856694-1-jingzhangos@google.com>

On Tue, 17 Aug 2021 01:26:39 +0100,
Jing Zhang <jingzhangos@google.com> wrote:
> 
> 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.

> 
> Original-by: David Matlack <dmatlack@google.com>
> Signed-off-by: Jing Zhang <jingzhangos@google.com>
> ---
>  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].

Thanks,

	M.

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

-- 
Without deviation from the norm, progress is not possible.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Jing Zhang <jingzhangos@google.com>
Cc: KVM <kvm@vger.kernel.org>, KVMARM <kvmarm@lists.cs.columbia.edu>,
	Paolo Bonzini <pbonzini@redhat.com>,
	David Matlack <dmatlack@google.com>,
	Peter Shier <pshier@google.com>, Oliver Upton <oupton@google.com>
Subject: Re: [PATCH] KVM: stats: Add VM stat for remote tlb flush requests
Date: Wed, 18 Aug 2021 09:11:45 +0100	[thread overview]
Message-ID: <87v943rx32.wl-maz@kernel.org> (raw)
In-Reply-To: <20210817002639.3856694-1-jingzhangos@google.com>

On Tue, 17 Aug 2021 01:26:39 +0100,
Jing Zhang <jingzhangos@google.com> wrote:
> 
> 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.

> 
> Original-by: David Matlack <dmatlack@google.com>
> Signed-off-by: Jing Zhang <jingzhangos@google.com>
> ---
>  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].

Thanks,

	M.

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

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2021-08-18  8:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17  0:26 [PATCH] KVM: stats: Add VM stat for remote tlb flush requests Jing Zhang
2021-08-17  0:26 ` Jing Zhang
2021-08-18  8:11 ` Marc Zyngier [this message]
2021-08-18  8:11   ` Marc Zyngier
2021-08-18 16:15   ` Jing Zhang
2021-08-18 16:15     ` Jing Zhang
2021-08-18 16:52     ` Marc Zyngier
2021-08-18 16:52       ` Marc Zyngier
2021-09-06 10:30       ` Paolo Bonzini
2021-09-06 10:30         ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v943rx32.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=dmatlack@google.com \
    --cc=jingzhangos@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=pbonzini@redhat.com \
    --cc=pshier@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.