[v5,0/8] bitmap: cleanup bitmap_*_region() implementation

Message ID 20230925023817.782509-1-yury.norov@gmail.com
Headers
Series bitmap: cleanup bitmap_*_region() implementation |

Message

Yury Norov Sept. 25, 2023, 2:38 a.m. UTC
  bitmap_{allocate,find_free,release}_region() functions are implemented
on top of _reg_op() machinery. It duplicates existing generic functionality
with no benefits. In fact, generic alternatives may work even better
because they optimized for small_const_nbits() case and overall very well
optimized for performance and code generation.

This series drops _reg_op() entirely.

v2: https://lore.kernel.org/lkml/20230811005732.107718-2-yury.norov@gmail.com/T/
v3: https://lore.kernel.org/lkml/20230815233628.45016-2-yury.norov@gmail.com/T/
v4: https://lore.kernel.org/lkml/20230829023911.64335-1-yury.norov@gmail.com/T/
v5: - fix bitmap_release_region() implementation;
    - address nits for commits comments.

Yury Norov (8):
  bitmap: align __reg_op() wrappers with modern coding style
  bitmap: add test for bitmap_*_region() functions
  bitmap: fix opencoded bitmap_allocate_region()
  bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set()
  bitmap: replace _reg_op(REG_OP_RELEASE) with bitmap_clear()
  bitmap: replace _reg_op(REG_OP_ISFREE) with find_next_bit()
  bitmap: drop _reg_op() function
  bitmap: move bitmap_*_region() functions to bitmap.h

 include/linux/bitmap.h |  63 ++++++++++++++++++-
 lib/bitmap.c           | 140 -----------------------------------------
 lib/test_bitmap.c      |  24 +++++++
 3 files changed, 84 insertions(+), 143 deletions(-)
  

Comments

Yury Norov Oct. 6, 2023, 4:44 p.m. UTC | #1
Ping?

On Sun, Sep 24, 2023 at 07:38:09PM -0700, Yury Norov wrote:
> bitmap_{allocate,find_free,release}_region() functions are implemented
> on top of _reg_op() machinery. It duplicates existing generic functionality
> with no benefits. In fact, generic alternatives may work even better
> because they optimized for small_const_nbits() case and overall very well
> optimized for performance and code generation.
> 
> This series drops _reg_op() entirely.
> 
> v2: https://lore.kernel.org/lkml/20230811005732.107718-2-yury.norov@gmail.com/T/
> v3: https://lore.kernel.org/lkml/20230815233628.45016-2-yury.norov@gmail.com/T/
> v4: https://lore.kernel.org/lkml/20230829023911.64335-1-yury.norov@gmail.com/T/
> v5: - fix bitmap_release_region() implementation;
>     - address nits for commits comments.
> 
> Yury Norov (8):
>   bitmap: align __reg_op() wrappers with modern coding style
>   bitmap: add test for bitmap_*_region() functions
>   bitmap: fix opencoded bitmap_allocate_region()
>   bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set()
>   bitmap: replace _reg_op(REG_OP_RELEASE) with bitmap_clear()
>   bitmap: replace _reg_op(REG_OP_ISFREE) with find_next_bit()
>   bitmap: drop _reg_op() function
>   bitmap: move bitmap_*_region() functions to bitmap.h
> 
>  include/linux/bitmap.h |  63 ++++++++++++++++++-
>  lib/bitmap.c           | 140 -----------------------------------------
>  lib/test_bitmap.c      |  24 +++++++
>  3 files changed, 84 insertions(+), 143 deletions(-)
> 
> -- 
> 2.39.2
  
Yury Norov Oct. 15, 2023, 2:58 a.m. UTC | #2
OK, if no objections, moving this to bitmap-for-next.

On Fri, Oct 06, 2023 at 09:44:04AM -0700, Yury Norov wrote:
> Ping?
> 
> On Sun, Sep 24, 2023 at 07:38:09PM -0700, Yury Norov wrote:
> > bitmap_{allocate,find_free,release}_region() functions are implemented
> > on top of _reg_op() machinery. It duplicates existing generic functionality
> > with no benefits. In fact, generic alternatives may work even better
> > because they optimized for small_const_nbits() case and overall very well
> > optimized for performance and code generation.
> > 
> > This series drops _reg_op() entirely.
> > 
> > v2: https://lore.kernel.org/lkml/20230811005732.107718-2-yury.norov@gmail.com/T/
> > v3: https://lore.kernel.org/lkml/20230815233628.45016-2-yury.norov@gmail.com/T/
> > v4: https://lore.kernel.org/lkml/20230829023911.64335-1-yury.norov@gmail.com/T/
> > v5: - fix bitmap_release_region() implementation;
> >     - address nits for commits comments.
> > 
> > Yury Norov (8):
> >   bitmap: align __reg_op() wrappers with modern coding style
> >   bitmap: add test for bitmap_*_region() functions
> >   bitmap: fix opencoded bitmap_allocate_region()
> >   bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set()
> >   bitmap: replace _reg_op(REG_OP_RELEASE) with bitmap_clear()
> >   bitmap: replace _reg_op(REG_OP_ISFREE) with find_next_bit()
> >   bitmap: drop _reg_op() function
> >   bitmap: move bitmap_*_region() functions to bitmap.h
> > 
> >  include/linux/bitmap.h |  63 ++++++++++++++++++-
> >  lib/bitmap.c           | 140 -----------------------------------------
> >  lib/test_bitmap.c      |  24 +++++++
> >  3 files changed, 84 insertions(+), 143 deletions(-)
> > 
> > -- 
> > 2.39.2