Skip to content

x86/topology: add bitmap_weight_from() and use it in topo_unit_count()

Yury Norov (NVIDIA) lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 1 replySuperseded

Changes in v2 from the cover letter

- 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.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bitmap: add bitmap_weight_from()include/linux/bitmap.h lib/test_bitmap.c+56 -00 replies
2/2x86/topology: use bitmap_weight_from()arch/x86/kernel/cpu/topology.c+2 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

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

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/[email protected]/
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(-)
Signature · 1 line
2.43.0