public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] x86/topology: add bitmap_weight_from() and use it in topo_unit_count()
@ 2025-12-22 19:11 Yury Norov (NVIDIA)
  2025-12-22 19:11 ` [PATCH v2 1/2] bitmap: add bitmap_weight_from() Yury Norov (NVIDIA)
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yury Norov (NVIDIA) @ 2025-12-22 19:11 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, Yury Norov, Rasmus Villemoes, Andrew Morton,
	Peter Zijlstra (Intel), Ilpo Järvinen, Tony Luck,
	Xin Li (Intel), Chang S. Bae, x86, linux-kernel

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.

v1: https://lore.kernel.org/all/20251214235437.244125-1-yury.norov@gmail.com/
v2:
 - rename 'nbits' to 'end' (Ingo);
 - leverage bitmap_weight() in inline implementation;
 - drop outline implementation;
 - don't handle 'start >= end' case explititly, leave it to user.

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

 arch/x86/kernel/cpu/topology.c |  8 ++------
 include/linux/bitmap.h         | 30 ++++++++++++++++++++++++++++++
 lib/test_bitmap.c              | 26 ++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 6 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-13 22:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 19:11 [PATCH v2 0/2] x86/topology: add bitmap_weight_from() and use it in topo_unit_count() Yury Norov (NVIDIA)
2025-12-22 19:11 ` [PATCH v2 1/2] bitmap: add bitmap_weight_from() Yury Norov (NVIDIA)
2025-12-22 19:11 ` [PATCH v2 2/2] x86/topology: use bitmap_weight_from() Yury Norov (NVIDIA)
2026-02-22 17:49 ` [PATCH v2 0/2] x86/topology: add bitmap_weight_from() and use it in topo_unit_count() Yury Norov
2026-03-13 22:42   ` Yury Norov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox