Skip to content

bitmap: rework bitmap_{bit,}remap()

Yury Norov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12bitmap: add find_nth_bit_from()include/linux/find.h lib/find_bit.c lib/test_bitmap.c+75 -10 replies
2/12bitmap: add bitmap_weight_from()include/linux/bitmap.h lib/bitmap.c lib/test_bitmap.c+57 -01 reply
3/12bitmap: add test for bitmap_remap()lib/test_bitmap.c+80 -00 replies
4/12bitmap: add test for bitmap_bitremap()lib/test_bitmap.c+34 -00 replies
5/12bitmap: update comment for bitmap_{bit,}remap()lib/bitmap.c+26 -280 replies
6/12bitmap: add small_cont_nbits() optimization for bitmap_remap()include/linux/bitmap.h lib/bitmap.c+66 -490 replies
7/12bitmap: add small_const_nbits() optimization for bitmap_bitremap()include/linux/bitmap.h lib/bitmap.c+36 -150 replies
8/12bitmap: optiimze bitmap_bitremap()lib/bitmap.c+10 -50 replies
9/12bitmap: optimize bitmap_remap() when 'new' is empty maplib/bitmap.c+5 -00 replies
10/12bitmap: separate handling of identity and remapping parts in bitmap_remap()lib/bitmap.c+7 -80 replies
11/12bitmap: defer calculating weight of 'new' in bitmap_remap()lib/bitmap.c+8 -70 replies
12/12bitmap: don't count bits from the beginning in bitmap_remap()lib/bitmap.c+19 -30 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/12] bitmap: rework bitmap_{bit,}remap()

This series adds a test, const-time optimizaton and fixes O(N^2) complexity problem for the functions. It's based on discussion in
bitmap: optimize bitmap_remap() series [1], but there's much more work here, so I decided to give it a separete run, and don't name it as v2.

bitmap_remap() API has just one user in generic code, and few more in drivers, so this may look like an overkill. But the work gives ~10x better performance for a 1000-bit bitmaps, which is typical for nodemasks in major distros like Ubuntu.

Anyways, the work is done, so guys please review.

[1] https://lore.kernel.org/lkml/[email protected]/T/
Yury Norov (12):
bitmap: add find_nth_bit_from()
bitmap: add bitmap_weight_from()
bitmap: add test for bitmap_remap()
bitmap: add test for bitmap_bitremap()
bitmap: update comment for bitmap_{bit,}remap()
bitmap: add small_cont_nbits() optimization for bitmap_remap()
bitmap: add small_const_nbits() optimization for bitmap_bitremap()
bitmap: optiimze bitmap_bitremap()
bitmap: optimize bitmap_remap() when 'new' is empty map
bitmap: separate handling of identity and remapping parts in
bitmap_remap()
bitmap: defer calculating weight of 'new' in bitmap_remap()
bitmap: don't count bits from the beginning in bitmap_remap()

 include/linux/bitmap.h | 116 +++++++++++++++++++++++++++++++--
 include/linux/find.h   |  37 +++++++++++
 lib/bitmap.c           | 145 ++++++++++++++++++++---------------------
 lib/find_bit.c         |  29 +++++++++
 lib/test_bitmap.c      | 142 +++++++++++++++++++++++++++++++++++++++-
 5 files changed, 388 insertions(+), 81 deletions(-)
Signature · 1 line
2.39.2