[PATCH 0/2] x86/topology: add bitmap_weight_from() and use it in topo_unit_count()

From: Yury Norov (NVIDIA)

Date: Sun Dec 14 2025 - 18:54:39 EST


Currently the function open-codes the missing bitmap_weight_from() with
a for-loop, which is known to be less effective. Add the helper and
switch topo_unit_count() to using it.

Yury Norov (NVIDIA) (2):
bitmap: add bitmap_weight_from()
topology: use bitmap_weight_from()

arch/x86/kernel/cpu/topology.c | 8 ++------
include/linux/bitmap.h | 25 +++++++++++++++++++++++++
lib/bitmap.c | 28 ++++++++++++++++++++++++++++
lib/test_bitmap.c | 29 +++++++++++++++++++++++++++++
4 files changed, 84 insertions(+), 6 deletions(-)

--
2.43.0