x86/mm: Replace nodes_weight() with nodes_empty() where appropriate
authorYury Norov <yury.norov@gmail.com>
Thu, 10 Feb 2022 22:49:09 +0000 (14:49 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 10 Apr 2022 20:35:38 +0000 (22:35 +0200)
commitc2a911d302b0d014a4d0d732a2bfc319e643eb62
tree0f64c293a81e4637a1ddaec7f8456d45090339fb
parent3a5ff1f6dd50f5e1c2aa87491910dd6d275af24b
x86/mm: Replace nodes_weight() with nodes_empty() where appropriate

Various mm code calls nodes_weight() to check if any bit of a given
nodemask is set.

This can be done more efficiently with nodes_empty() because nodes_empty()
stops traversing the nodemask as soon as it finds first set bit, while
nodes_weight() counts all bits unconditionally.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220210224933.379149-26-yury.norov@gmail.com
arch/x86/mm/amdtopology.c
arch/x86/mm/numa_emulation.c