All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] bitmap: rework bitmap_{bit,}remap()
@ 2023-08-28 18:43 Yury Norov
  2023-08-28 18:43 ` [PATCH 01/12] bitmap: add find_nth_bit_from() Yury Norov
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Yury Norov @ 2023-08-28 18:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Yury Norov, Andy Shevchenko, Rasmus Villemoes

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/20230815235934.47782-1-yury.norov@gmail.com/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(-)

-- 
2.39.2


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

end of thread, other threads:[~2023-08-29 14:57 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-28 18:43 [PATCH 00/12] bitmap: rework bitmap_{bit,}remap() Yury Norov
2023-08-28 18:43 ` [PATCH 01/12] bitmap: add find_nth_bit_from() Yury Norov
2023-08-28 18:43 ` [PATCH 02/12] bitmap: add bitmap_weight_from() Yury Norov
2023-08-29  7:22   ` Rasmus Villemoes
2023-08-28 18:43 ` [PATCH 03/12] bitmap: add test for bitmap_remap() Yury Norov
2023-08-28 18:43 ` [PATCH 04/12] bitmap: add test for bitmap_bitremap() Yury Norov
2023-08-28 18:43 ` [PATCH 05/12] bitmap: update comment for bitmap_{bit,}remap() Yury Norov
2023-08-28 18:43 ` [PATCH 06/12] bitmap: add small_cont_nbits() optimization for bitmap_remap() Yury Norov
2023-08-28 18:43 ` [PATCH 07/12] bitmap: add small_const_nbits() optimization for bitmap_bitremap() Yury Norov
2023-08-28 18:43 ` [PATCH 08/12] bitmap: optiimze bitmap_bitremap() Yury Norov
2023-08-28 18:43 ` [PATCH 09/12] bitmap: optimize bitmap_remap() when 'new' is empty map Yury Norov
2023-08-28 18:43 ` [PATCH 10/12] bitmap: separate handling of identity and remapping parts in bitmap_remap() Yury Norov
2023-08-28 18:43 ` [PATCH 11/12] bitmap: defer calculating weight of 'new' " Yury Norov
2023-08-28 18:43 ` [PATCH 12/12] bitmap: don't count bits from the beginning " Yury Norov
2023-08-29  7:33 ` [PATCH 00/12] bitmap: rework bitmap_{bit,}remap() Rasmus Villemoes
2023-08-29 13:38   ` Andy Shevchenko
2023-08-29 13:50     ` Yury Norov
2023-08-29 14:56       ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.