KVM: Pre-allocate cpumasks for kvm_make_all_cpus_request_except()
stable inclusion from stable-v5.10.177 commit 7958663668ef0ffe49c294ee55c83770b532c685 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7958663668ef0ffe49c294ee55c83770b532c685 -------------------------------- [ Upstream commit baff59cc ] Allocating cpumask dynamically in zalloc_cpumask_var() is not ideal. Allocation is somewhat slow and can (in theory and when CPUMASK_OFFSTACK) fail. kvm_make_all_cpus_request_except() already disables preemption so we can use pre-allocated per-cpu cpumasks instead. Signed-off-by:Vitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by:
Sean Christopherson <seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20210903075141.403071-8-vkuznets@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Stable-dep-of: 2b012812 ("KVM: Register /dev/kvm as the _very_ last thing during initialization") Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com> Conflicts: virt/kvm/kvm_main.c
Loading
Please sign in to comment