On 04.02.2022 21:31, Andrew Cooper wrote: > cpumask_weight() is a horribly expensive way to find if no bits are set, made > worse by the fact that the calculation is performed with the global call_lock > held. > > Switch to using cpumask_empty() instead, which will short circuit as soon as > it find any set bit in the cpumask. > > Signed-off-by: Andrew Cooper <[email protected]>
May I suggest to drop "horribly"? How expensive one is compared to the other depends on the number of CPUs actually enumerated in the system. (And of course I still have that conversion to POPCNT alternatives patching pending, where Roger did ask for some re-work in reply to v2, but where it has remained unclear whether investing time into that wouldn't be in vein, considering some of your replies on v1. Thus would have further shrunk the difference, without me meaning to say the change here isn't a good one.) Reviewed-by: Jan Beulich <[email protected]> Jan
