[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87wnnu416f.fsf@vitty.brq.redhat.com>
Date: Mon, 06 Sep 2021 09:23:52 +0200
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: kvm@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
"Dr. David Alan Gilbert" <dgilbert@...hat.com>,
Nitesh Narayan Lal <nitesh@...hat.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Maxim Levitsky <mlevitsk@...hat.com>,
Eduardo Habkost <ehabkost@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 8/8] KVM: Make kvm_make_vcpus_request_mask() use
pre-allocated cpu_kick_mask
Sean Christopherson <seanjc@...gle.com> writes:
> On Fri, Sep 03, 2021, Vitaly Kuznetsov wrote:
>> kvm_make_vcpus_request_mask() already disables preemption so just like
>> kvm_make_all_cpus_request_except() it can be switched to using
>> pre-allocated per-cpu cpumasks. This allows for improvements for both
>> users of the function: in Hyper-V emulation code 'tlb_flush' can now be
>> dropped from 'struct kvm_vcpu_hv' and kvm_make_scan_ioapic_request_mask()
>> gets rid of dynamic allocation.
>>
>> cpumask_available() checks in kvm_make_vcpu_request() and
>> kvm_kick_many_cpus() can now be dropped as they checks for an impossible
>> condition: kvm_init() makes sure per-cpu masks are allocated.
>>
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
>> ---
>
> Reviewed-by: Sean Christopherson <seanjc@...gle.com>
>
Thanks!
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index a4752dcc2a75..91c1e6c98b0f 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -9224,14 +9224,8 @@ static void process_smi(struct kvm_vcpu *vcpu)
>> void kvm_make_scan_ioapic_request_mask(struct kvm *kvm,
>> unsigned long *vcpu_bitmap)
>> {
>> - cpumask_var_t cpus;
>> -
>> - zalloc_cpumask_var(&cpus, GFP_ATOMIC);
>> -
>> kvm_make_vcpus_request_mask(kvm, KVM_REQ_SCAN_IOAPIC,
>> - vcpu_bitmap, cpus);
>> -
>> - free_cpumask_var(cpus);
>> + vcpu_bitmap);
>
> Nit, this can all go on a single line.
>
Sorry, you've mentioned this on v4 but I forgot. Hope this can be fixed
upon commit...
>> }
>>
>> void kvm_make_scan_ioapic_request(struct kvm *kvm)
>
--
Vitaly
Powered by blists - more mailing lists