From: Paolo Bonzini <pbonzini@redhat.com>
To: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
Liang Chen <liangchen.linux@gmail.com>
Cc: kvm@vger.kernel.org, rkrcmar@redhat.com
Subject: Re: [PATCH v2] KVM: x86: count actual tlb flushes
Date: Thu, 18 Sep 2014 14:47:55 +0200 [thread overview]
Message-ID: <541AD47B.2010102@redhat.com> (raw)
In-Reply-To: <541A681B.1020503@linux.vnet.ibm.com>
Il 18/09/2014 07:05, Xiao Guangrong ha scritto:
> On 09/18/2014 02:35 AM, Liang Chen wrote:
>> - we count KVM_REQ_TLB_FLUSH requests, not actual flushes
>> (KVM can have multiple requests for one flush)
>> - flushes from kvm_flush_remote_tlbs aren't counted
>> - it's easy to make a direct request by mistake
>>
>> Solve these by postponing the counting to kvm_check_request(),
>
> It's good.
>
>> and refactor the code to use kvm_make_request again.
>
> Why this refactor is needed? It's really a bad idea using
> raw-bit-set instead of meaningful name.
set_bit is worse than kvm_make_request, but adding a one-line wrapper
around kvm_make_request is not particularly useful.
We have the following requests:
- used multiple times:
kvm_make_request(KVM_REQ_APF_HALT, vcpu);
kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
kvm_make_request(KVM_REQ_EVENT, vcpu);
kvm_make_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu);
kvm_make_request(KVM_REQ_PMU, pmc->vcpu);
kvm_make_request(KVM_REQ_STEAL_UPDATE, vcpu);
kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu);
kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu);
- used once:
kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu);
kvm_make_request(KVM_REQ_MMU_SYNC, vcpu);
kvm_make_request(KVM_REQ_NMI, vcpu);
kvm_make_request(KVM_REQ_PENDING_TIMER, vcpu);
kvm_make_request(KVM_REQ_PMI, pmc->vcpu);
kvm_make_request(KVM_REQ_REPORT_TPR_ACCESS, vcpu);
So I'm pretty much ambivalent about that. However, I agree with this
suggestion:
> [ Btw, maybe kvm_mmu_flush_local_tlb is a better name than
> kvm_mmu_flush_tlb() in the current code. ]
Or even better, call it kvm_vcpu_flush_tlb since it is all within
x86.c/vmx.c/svm.c and the MMU is not involved at all.
Paolo
next prev parent reply other threads:[~2014-09-18 12:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-17 18:35 [PATCH v2] KVM: x86: count actual tlb flushes Liang Chen
2014-09-18 5:05 ` Xiao Guangrong
2014-09-18 12:47 ` Paolo Bonzini [this message]
2014-09-18 13:49 ` Liang Chen
2014-09-18 14:08 ` Radim Krčmář
2014-09-18 14:00 ` Radim Krčmář
2014-09-18 14:47 ` Liang Chen
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=541AD47B.2010102@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=liangchen.linux@gmail.com \
--cc=rkrcmar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox