[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANRm+Cz9L9xTe-zGcuqoXD0Q44xvw0Q2Gp_C=NR3t=j6oq-QXQ@mail.gmail.com>
Date: Wed, 14 Feb 2018 11:03:29 +0800
From: Wanpeng Li <kernellwp@...il.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kvm <kvm@...r.kernel.org>,
Radim Krčmář <rkrcmar@...hat.com>,
Eduardo Habkost <ehabkost@...hat.com>
Subject: Re: [PATCH v4 3/3] KVM: X86: Don't use PV TLB flush with dedicated
vCPUs and steal time disabled
2018-02-14 0:12 GMT+08:00 Paolo Bonzini <pbonzini@...hat.com>:
> On 13/02/2018 02:05, Wanpeng Li wrote:
>> From: Wanpeng Li <wanpengli@...cent.com>
>>
>> vCPUs are very unlikely to get preempted when they are the only task
>> running on a CPU. PV TLB flush is slower that the native flush in that
>> case. In addition, avoid traversing all the cpus for pv tlb flush when
>> steal time is disabled since pv tlb flush depends on the field in steal
>> time for shared data.
>>
>> Cc: Paolo Bonzini <pbonzini@...hat.com>
>> Cc: Radim Krčmář <rkrcmar@...hat.com>
>> Cc: Eduardo Habkost <ehabkost@...hat.com>
>> Signed-off-by: Wanpeng Li <wanpengli@...cent.com>
>> ---
>> arch/x86/kernel/kvm.c | 8 ++++++--
>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
>> index c5566d9..285822f 100644
>> --- a/arch/x86/kernel/kvm.c
>> +++ b/arch/x86/kernel/kvm.c
>> @@ -545,7 +545,9 @@ static void __init kvm_guest_init(void)
>> pv_time_ops.steal_clock = kvm_steal_clock;
>> }
>>
>> - if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH))
>> + if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
>> + !kvm_para_has_feature(KVM_HINTS_DEDICATED) &&
>> + !kvm_para_has_feature(KVM_FEATURE_STEAL_TIME))
>> pv_mmu_ops.flush_tlb_others = kvm_flush_tlb_others;
>>
>> if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
>> @@ -638,7 +640,9 @@ static __init int kvm_setup_pv_tlb_flush(void)
>> {
>> int cpu;
>>
>> - if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH)) {
>> + if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
>> + !kvm_para_has_feature(KVM_HINTS_DEDICATED) &&
>
> This should have checked the hints word.
>
> In general, I'm going to change in the whole series
> kvm_hint_has_feature with kvm_para_has_hint, and kvm_arch_hint_features
> with kvm_arch_para_hints. But apart from this small naming issue, the
> series looks good, and I'm applying it to kvm/queue.
Thanks Paolo.
Regards,
Wanpeng Li
Powered by blists - more mailing lists