All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
To: dave@gnu.org
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
	lkml <linux-kernel@vger.kernel.org>,
	kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: MMU: increment stats after event occurrence
Date: Fri, 13 Jan 2012 10:24:14 +0900	[thread overview]
Message-ID: <4F0F87BE.2020202@oss.ntt.co.jp> (raw)
In-Reply-To: <1326416880.3416.2.camel@offbook>

(2012/01/13 10:08), Davidlohr Bueso wrote:
> From: Davidlohr Bueso<dave@gnu.org>
>
> It makes more sense to actually increment statistics for tlb flushes and page table entry updates after such _events_ occur, instead of before.

Why?

	Takuya

>
> Signed-off-by: Davidlohr Bueso<dave@gnu.org>
> ---
>   arch/x86/kvm/mmu.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 2a2a9b4..0b7008e 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -3130,8 +3130,8 @@ static int nonpaging_init_context(struct kvm_vcpu *vcpu,
>
>   void kvm_mmu_flush_tlb(struct kvm_vcpu *vcpu)
>   {
> -	++vcpu->stat.tlb_flush;
>   	kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu);
> +	++vcpu->stat.tlb_flush;
>   }
>
>   static void paging_new_cr3(struct kvm_vcpu *vcpu)
> @@ -3486,8 +3486,8 @@ static void mmu_pte_write_new_pte(struct kvm_vcpu *vcpu,
>   		return;
>           }
>
> -	++vcpu->kvm->stat.mmu_pte_updated;
>   	vcpu->arch.mmu.update_pte(vcpu, sp, spte, new);
> +	++vcpu->kvm->stat.mmu_pte_updated;
>   }
>
>   static bool need_remote_flush(u64 old, u64 new)


  reply	other threads:[~2012-01-13  1:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13  1:08 [PATCH] KVM: MMU: increment stats after event occurrence Davidlohr Bueso
2012-01-13  1:24 ` Takuya Yoshikawa [this message]
2012-01-13 12:56   ` Davidlohr Bueso
2012-01-15 14:04     ` Avi Kivity

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=4F0F87BE.2020202@oss.ntt.co.jp \
    --to=yoshikawa.takuya@oss.ntt.co.jp \
    --cc=avi@redhat.com \
    --cc=dave@gnu.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=xiaoguangrong@linux.vnet.ibm.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.