]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
KVM: Optimize kvm_make_vcpus_request_mask() a bit
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 3 Sep 2021 07:51:37 +0000 (09:51 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 30 Sep 2021 08:27:03 +0000 (04:27 -0400)
commitae0946cd3601752dc58f86d84258e5361e9c8cd4
tree8eef0efc9dc2d5eee6069f3a00a32387557fc875
parent6470accc7ba948b0b3aca22b273fe84ec638a116
KVM: Optimize kvm_make_vcpus_request_mask() a bit

Iterating over set bits in 'vcpu_bitmap' should be faster than going
through all vCPUs, especially when just a few bits are set.

Drop kvm_make_vcpus_request_mask() call from kvm_make_all_cpus_request_except()
to avoid handling the special case when 'vcpu_bitmap' is NULL, move the
code to kvm_make_all_cpus_request_except() itself.

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-5-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c