Re: [PATCH v1 1/1] bitops: Share BYTES_TO_BITS() for everyone

2023-09-10 Thread Yury Norov
On Wed, Sep 06, 2023 at 05:54:26PM +0300, Andy Shevchenko wrote: > On Wed, Sep 06, 2023 at 04:40:39PM +0200, Alexander Lobakin wrote: > > From: Andy Shevchenko > > Date: Thu, 31 Aug 2023 16:21:30 +0300 > > > On Fri, Aug 25, 2023 at 04:49:07PM +0200, Alexander Lobakin wrote: > > >> From: Andy

Re: [PATCH 2/2] rcu/tree_plugin: don't handle the case of 'all' CPU range

2021-04-20 Thread Yury Norov
On Tue, Apr 20, 2021 at 01:18:40PM +0300, Andy Shevchenko wrote: > On Mon, Apr 19, 2021 at 05:01:31PM -0700, Yury Norov wrote: > > The 'all' semantics is now supported by the bitmap_parselist() so we can > > drop supporting it as a special case in RCU code. This patch does

Re: [PATCH 1/2] bitmap_parse: support 'all' semantics

2021-04-20 Thread Yury Norov
On Tue, Apr 20, 2021 at 01:17:52PM +0300, Andy Shevchenko wrote: > On Mon, Apr 19, 2021 at 05:01:30PM -0700, Yury Norov wrote: > > RCU code supports an 'all' group as a special case when parsing > > rcu_nocbs parameter. This patch moves the 'all' support to the core > >

[PATCH 2/2] rcu/tree_plugin: don't handle the case of 'all' CPU range

2021-04-19 Thread Yury Norov
The 'all' semantics is now supported by the bitmap_parselist() so we can drop supporting it as a special case in RCU code. This patch does not add any functional changes for existing users. Signed-off-by: Yury Norov --- kernel/rcu/tree_plugin.h | 9 +++-- 1 file changed, 3 insertions(+), 6

[PATCH 0/2] bitmap_parselist: support 'all' semantics

2021-04-19 Thread Yury Norov
as a common and easy-readable alias for '0-N'. Moving the 'all' support to core bitmap code adds another level of flexibility for system configuration by supporting patterns. For example, every second bit in cpumask may be selected like this: isolcpus=all:1/2 Yury Norov (2): bitmap_parse

[PATCH 1/2] bitmap_parse: support 'all' semantics

2021-04-19 Thread Yury Norov
with 'all' in regular group:pattern format Signed-off-by: Yury Norov --- Documentation/admin-guide/kernel-parameters.rst | 5 + lib/bitmap.c| 9 + lib/test_bitmap.c | 8 +++- 3 files changed, 21 insertions(+), 1 deletion

Re: [PATCH] Documentation: syscalls: add a note about ABI-agnostic types

2021-04-15 Thread Yury Norov
> > > > Em Tue, 13 Apr 2021 21:40:20 -0700 > > > > Yury Norov escreveu: > > > > > > > > > Ping? > > > > > > > > > > On Fri, Apr 09, 2021 at 01:43:04PM -0700, Yury Norov wrote: > > > > > > Rec

Re: [PATCH] Documentation: syscalls: add a note about ABI-agnostic types

2021-04-14 Thread Yury Norov
On Wed, Apr 14, 2021 at 08:14:22AM +0200, Mauro Carvalho Chehab wrote: > Em Tue, 13 Apr 2021 21:40:20 -0700 > Yury Norov escreveu: > > > Ping? > > > > On Fri, Apr 09, 2021 at 01:43:04PM -0700, Yury Norov wrote: > > > Recently added memfd_secret()

Re: [PATCH] Documentation: syscalls: add a note about ABI-agnostic types

2021-04-13 Thread Yury Norov
Ping? On Fri, Apr 09, 2021 at 01:43:04PM -0700, Yury Norov wrote: > Recently added memfd_secret() syscall had a flags parameter passed > as unsigned long, which requires creation of compat entry for it. > It was possible to change the type of flags to unsigned int and so > avo

[PATCH] Documentation: syscalls: add a note about ABI-agnostic types

2021-04-09 Thread Yury Norov
Documentation/process/adding-syscalls.rst doesn't point clearly about preference of ABI-agnostic types. This patch adds such notification. Signed-off-by: Yury Norov --- Documentation/process/adding-syscalls.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Documentation/process/adding

Re: [PATCH v1 1/5] bitmap: Make bitmap_remap() and bitmap_bitremap() available to users

2021-04-08 Thread Yury Norov
* bitmap_onto - translate one bitmap relative to another > * @dst: resulting translated bitmap > -- > 2.30.2 Acked-by: Yury Norov

[PATCH v2] h8300: rearrange headers inclusion order in asm/bitops

2021-04-06 Thread Yury Norov
in find.h requires ffs/fls. Reordering the headers inclusion sequence helps to prevent compile-time implicit function declaration error. v2: change wording in the comment. Reported-by: kernel test robot Reported-by: Guenter Roeck Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov ---

Re: [PATCH 11/13] lib: add fast path for find_first_*_bit() and find_last_bit()

2021-04-06 Thread Yury Norov
On Tue, Apr 06, 2021 at 09:03:27AM -0700, Guenter Roeck wrote: > On Mon, Mar 15, 2021 at 06:54:22PM -0700, Yury Norov wrote: > > Similarly to bitmap functions, users would benefit if we'll handle > > a case of small-size bitmaps that fit into a single word. > >

[PATCH] h8300: rearrange headers inclusion order in asm/bitops

2021-04-01 Thread Yury Norov
quires ffs/fls. Reordering the headers inclusion sequence helps to prevent compile-time implicit function declaration error. Reported-by: kernel test robot Signed-off-by: Yury Norov --- arch/h8300/include/asm/bitops.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/

[PATCH 12/12] MAINTAINERS: Add entry for the bitmap API

2021-03-31 Thread Yury Norov
Add myself as maintainer for bitmap API and Andy and Rasmus as reviewers. Signed-off-by: Yury Norov Acked-by: Andy Shevchenko Acked-by: Rasmus Villemoes --- MAINTAINERS | 16 1 file changed, 16 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bbd4484b5ba6

[PATCH 07/12] lib: inline _find_next_bit() wrappers

2021-03-31 Thread Yury Norov
lib/find_bit.c declares five single-line wrappers for _find_next_bit(). We may turn those wrappers to inline functions. It eliminates unneeded function calls and opens room for compile-time optimizations. Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes --- include/asm-generic/bitops

[PATCH 06/12] tools: sync small_const_nbits() macro with the kernel

2021-03-31 Thread Yury Norov
Sync implementation with the kernel and move the macro from tools/include/linux/bitmap.h to tools/include/asm-generic/bitsperlong.h Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes --- tools/include/asm-generic/bitsperlong.h | 3 +++ tools/include/linux/bitmap.h| 3 --- 2 files

[PATCH 10/12] lib: add fast path for find_first_*_bit() and find_last_bit()

2021-03-31 Thread Yury Norov
Similarly to bitmap functions, users would benefit if we'll handle a case of small-size bitmaps that fit into a single word. While here, move the find_last_bit() declaration to bitops/find.h where other find_*_bit() functions sit. Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes

[PATCH 11/12] tools: sync lib/find_bit implementation

2021-03-31 Thread Yury Norov
Add fast paths to find_*_bit() functions as per kernel implementation. Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes --- tools/include/asm-generic/bitops/find.h | 58 +++-- tools/lib/find_bit.c| 4 +- 2 files changed, 57 insertions(+), 5

[PATCH 09/12] lib: add fast path for find_next_*_bit()

2021-03-31 Thread Yury Norov
/176 up/down: 5780/-6768 (-988) Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes --- include/asm-generic/bitops/find.h | 30 ++ include/asm-generic/bitops/le.h | 21 + 2 files changed, 51 insertions(+) diff --git a/include/asm-generic/bitops

[PATCH 08/12] tools: sync find_next_bit implementation

2021-03-31 Thread Yury Norov
Sync the implementation with recent kernel changes. Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes --- tools/include/asm-generic/bitops/find.h | 27 ++--- tools/lib/find_bit.c| 52 ++--- 2 files changed, 42 insertions(+), 37 deletions

[PATCH 04/12] arch: rearrange headers inclusion order in asm/bitops for m68k and sh

2021-03-31 Thread Yury Norov
m68k and sh include bitmap/{find,le}.h prior to ffs/fls headers. New fast-path implementation in find.h requires ffs/fls. Reordering the headers inclusion sequence helps to prevent compile-time implicit function declaration error. Signed-off-by: Yury Norov Acked-by: Geert Uytterhoeven Acked

[PATCH 05/12] lib: extend the scope of small_const_nbits() macro

2021-03-31 Thread Yury Norov
find_bit would also benefit from small_const_nbits() optimizations. The detailed comment is provided by Rasmus Villemoes. Suggested-by: Rasmus Villemoes Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes --- include/asm-generic/bitsperlong.h | 12 include/linux/bitmap.h

[PATCH v6 00/12] lib/find_bit: fast path for small bitmaps

2021-03-31 Thread Yury Norov
rch/20210321215457.588554-1-yury.no...@gmail.com/T/ v6: - sync small_const_nbits() properly (patch 6). - Rasmus' ack added. Yury Norov (12): tools: disable -Wno-type-limits tools: bitmap: sync function declarations with the kernel tools: sync BITMAP_LAST_WORD_MASK() macro with the kernel a

[PATCH 01/12] tools: disable -Wno-type-limits

2021-03-31 Thread Yury Norov
GENMASK(h, l) may be passed with unsigned types. In such case, type-limits warning is generated for example in case of GENMASK(h, 0). Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes --- tools/scripts/Makefile.include | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/scripts

[PATCH 03/12] tools: sync BITMAP_LAST_WORD_MASK() macro with the kernel

2021-03-31 Thread Yury Norov
Kernel version generates better code. Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes --- tools/include/linux/bitmap.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/include/linux/bitmap.h b/tools/include/linux/bitmap.h index 7cbd23e56d48..4aabc23ec747

[PATCH 02/12] tools: bitmap: sync function declarations with the kernel

2021-03-31 Thread Yury Norov
Some functions in tools/include/linux/bitmap.h declare nbits as int. In the kernel nbits is declared as unsigned int. Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes --- tools/include/linux/bitmap.h | 8 tools/lib/bitmap.c | 4 ++-- 2 files changed, 6 insertions(+), 6

Re: [PATCH] memfd_secret: use unsigned int rather than long as syscall flags type

2021-03-31 Thread Yury Norov
ned int, but not true for unsigned long or pointer. > > That's why I suggest using unsigned int and so avoid creating compat > entry point. > > Use unsigned int as the type of the flags parameter in memfd_secret() > system call. > > Signed-off-by: Mike Rapoport Acked-by: Yury Norov

Re: [PATCH v1 1/1] kernel.h: Drop inclusion in bitmap.h

2021-03-27 Thread Yury Norov
tmap.h followed by replacing kernel.h with limits.h. > > Signed-off-by: Andy Shevchenko Can you give an example of such dependency? Nevertheless, Acked-by: Yury Norov > --- > include/linux/align.h | 15 +++ > include/linux/bitmap.h | 3 ++- > include/linux/kernel.h

Re: [PATCH 06/12] tools: sync small_const_nbits() macro with the kernel

2021-03-24 Thread Yury Norov
On Mon, Mar 22, 2021 at 09:34:47AM +0100, Rasmus Villemoes wrote: > On 21/03/2021 22.54, Yury Norov wrote: > > Move the macro from tools/include/asm-generic/bitsperlong.h > > to tools/include/linux/bitmap.h > > The patch does it the other way around :) > >

[PATCH 11/12] tools: sync lib/find_bit implementation

2021-03-21 Thread Yury Norov
Add fast paths to find_*_bit() functions as per kernel implementation. Signed-off-by: Yury Norov --- tools/include/asm-generic/bitops/find.h | 58 +++-- tools/lib/find_bit.c| 4 +- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/tools

[PATCH 12/12] MAINTAINERS: Add entry for the bitmap API

2021-03-21 Thread Yury Norov
Add myself as maintainer for bitmap API and Andy and Rasmus as reviewers. Signed-off-by: Yury Norov Acked-by: Andy Shevchenko Acked-by: Rasmus Villemoes --- MAINTAINERS | 16 1 file changed, 16 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 38ee5c1a7c3a

[PATCH 07/12] lib: inline _find_next_bit() wrappers

2021-03-21 Thread Yury Norov
lib/find_bit.c declares five single-line wrappers for _find_next_bit(). We may turn those wrappers to inline functions. It eliminates unneeded function calls and opens room for compile-time optimizations. Signed-off-by: Yury Norov --- include/asm-generic/bitops/find.h | 28

[PATCH 10/12] lib: add fast path for find_first_*_bit() and find_last_bit()

2021-03-21 Thread Yury Norov
Similarly to bitmap functions, users would benefit if we'll handle a case of small-size bitmaps that fit into a single word. While here, move the find_last_bit() declaration to bitops/find.h where other find_*_bit() functions sit. Signed-off-by: Yury Norov --- include/asm-generic/bitops/find.h

[PATCH 09/12] lib: add fast path for find_next_*_bit()

2021-03-21 Thread Yury Norov
/176 up/down: 5780/-6768 (-988) Signed-off-by: Yury Norov --- include/asm-generic/bitops/find.h | 30 ++ include/asm-generic/bitops/le.h | 21 + 2 files changed, 51 insertions(+) diff --git a/include/asm-generic/bitops/find.h b/include/asm

[PATCH 08/12] tools: sync find_next_bit implementation

2021-03-21 Thread Yury Norov
Sync the implementation with recent kernel changes. Signed-off-by: Yury Norov --- tools/include/asm-generic/bitops/find.h | 27 ++--- tools/lib/find_bit.c| 52 ++--- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/tools/include

[PATCH 01/12] tools: disable -Wno-type-limits

2021-03-21 Thread Yury Norov
GENMASK(h, l) may be passed with unsigned types. In such case, type-limits warning is generated for example in case of GENMASK(h, 0). Signed-off-by: Yury Norov --- tools/scripts/Makefile.include | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/scripts/Makefile.include b/tools/scripts

[PATCH 02/12] tools: bitmap: sync function declarations with the kernel

2021-03-21 Thread Yury Norov
Some functions in tools/include/linux/bitmap.h declare nbits as int. In the kernel nbits is declared as unsigned int. Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes --- tools/include/linux/bitmap.h | 8 tools/lib/bitmap.c | 4 ++-- 2 files changed, 6 insertions(+), 6

[PATCH 05/12] lib: extend the scope of small_const_nbits() macro

2021-03-21 Thread Yury Norov
find_bit would also benefit from small_const_nbits() optimizations. The detailed comment is provided by Rasmus Villemoes. Signed-off-by: Yury Norov Suggested-by: Rasmus Villemoes --- include/asm-generic/bitsperlong.h | 12 include/linux/bitmap.h| 8 2 files

[PATCH 04/12] arch: rearrange headers inclusion order in asm/bitops for m68k and sh

2021-03-21 Thread Yury Norov
m68k and sh include bitmap/{find,le}.h prior to ffs/fls headers. New fast-path implementation in find.h requires ffs/fls. Reordering the headers inclusion sequence helps to prevent compile-time implicit function declaration error. Signed-off-by: Yury Norov Acked-by: Geert Uytterhoeven --- arch

[PATCH 06/12] tools: sync small_const_nbits() macro with the kernel

2021-03-21 Thread Yury Norov
Move the macro from tools/include/asm-generic/bitsperlong.h to tools/include/linux/bitmap.h Signed-off-by: Yury Norov --- tools/include/asm-generic/bitsperlong.h | 3 +++ tools/include/linux/bitmap.h| 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools

[PATCH 03/12] tools: sync BITMAP_LAST_WORD_MASK() macro with the kernel

2021-03-21 Thread Yury Norov
Kernel version generates better code. Signed-off-by: Yury Norov --- tools/include/linux/bitmap.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/include/linux/bitmap.h b/tools/include/linux/bitmap.h index 7cbd23e56d48..4aabc23ec747 100644 --- a/tools/include

[PATCH v5 00/12] lib/find_bit: fast path for small bitmaps

2021-03-21 Thread Yury Norov
tps://www.spinics.net/lists/kernel/msg3837020.html v4: https://patchwork.kernel.org/project/linux-sh/cover/20210316015424.1999082-1-yury.no...@gmail.com/ v5: - drop BITS_{FIRST,LAST} patch; - minor changes. Yury Norov (12): tools: disable -Wno-type-limits tools: bitmap: sync function declarati

Re: [PATCH 04/13] lib: introduce BITS_{FIRST,LAST} macro

2021-03-17 Thread Yury Norov
On Wed, Mar 17, 2021 at 08:58:04PM +0100, Rasmus Villemoes wrote: > On 17/03/2021 06.40, Yury Norov wrote: > > On Tue, Mar 16, 2021 at 01:42:45PM +0200, Andy Shevchenko wrote: > > >>> It would also be much easier to review if you just redefined the > >>> BITMAP

Re: [PATCH 13/13] MAINTAINERS: Add entry for the bitmap API

2021-03-17 Thread Yury Norov
On Wed, Mar 17, 2021 at 07:40:04AM +0100, Lukas Bulwahn wrote: > On Wed, Mar 17, 2021 at 5:57 AM Joe Perches wrote: > > > > On Tue, 2021-03-16 at 21:47 -0700, Yury Norov wrote: > > > [CC Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn] > > > > &g

Re: [PATCH 04/13] lib: introduce BITS_{FIRST,LAST} macro

2021-03-16 Thread Yury Norov
On Tue, Mar 16, 2021 at 01:42:45PM +0200, Andy Shevchenko wrote: > On Tue, Mar 16, 2021 at 09:35:35AM +0100, Rasmus Villemoes wrote: > > On 16/03/2021 02.54, Yury Norov wrote: > > > BITMAP_{LAST,FIRST}_WORD_MASK() in linux/bitmap.h duplicates the > > > functional

Re: [PATCH 06/13] lib: extend the scope of small_const_nbits() macro

2021-03-16 Thread Yury Norov
On Tue, Mar 16, 2021 at 09:56:49AM +0100, Rasmus Villemoes wrote: > On 16/03/2021 02.54, Yury Norov wrote: > > find_bit would also benefit from small_const_nbits() optimizations. > > > > Signed-off-by: Yury Norov > > --- > > include/asm-generic/bitsperlong.h

Re: [PATCH 13/13] MAINTAINERS: Add entry for the bitmap API

2021-03-16 Thread Yury Norov
[CC Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn] On Tue, Mar 16, 2021 at 01:45:51PM +0200, Andy Shevchenko wrote: > On Mon, Mar 15, 2021 at 06:54:24PM -0700, Yury Norov wrote: > > Add myself as maintainer for bitmap API and Andy and Rasmus as reviewers. > > &g

[PATCH 10/13] lib: add fast path for find_next_*_bit()

2021-03-15 Thread Yury Norov
/176 up/down: 5780/-6768 (-988) Signed-off-by: Yury Norov --- include/asm-generic/bitops/find.h | 30 ++ include/asm-generic/bitops/le.h | 21 + 2 files changed, 51 insertions(+) diff --git a/include/asm-generic/bitops/find.h b/include/asm

[PATCH 12/13] tools: sync lib/find_bit implementation

2021-03-15 Thread Yury Norov
Add fast paths to find_*_bit() functions as per kernel implementation. Signed-off-by: Yury Norov --- tools/include/asm-generic/bitops/find.h | 58 +++-- tools/lib/find_bit.c| 4 +- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/tools

[PATCH 11/13] lib: add fast path for find_first_*_bit() and find_last_bit()

2021-03-15 Thread Yury Norov
Similarly to bitmap functions, users would benefit if we'll handle a case of small-size bitmaps that fit into a single word. While here, move the find_last_bit() declaration to bitops/find.h where other find_*_bit() functions sit. Signed-off-by: Yury Norov --- include/asm-generic/bitops/find.h

[PATCH 13/13] MAINTAINERS: Add entry for the bitmap API

2021-03-15 Thread Yury Norov
Add myself as maintainer for bitmap API and Andy and Rasmus as reviewers. I'm an author of current implementation of lib/find_bit and an active contributor to lib/bitmap. It was spotted that there's no maintainer for bitmap API. I'm willing to maintain it. Signed-off-by: Yury Norov Acked

[PATCH 08/13] lib: inline _find_next_bit() wrappers

2021-03-15 Thread Yury Norov
lib/find_bit.c declares five single-line wrappers for _find_next_bit(). We may turn those wrappers to inline functions. It eliminates unneeded function calls and opens room for compile-time optimizations. Signed-off-by: Yury Norov --- include/asm-generic/bitops/find.h | 28

[PATCH 05/13] tools: sync BITS_MASK macros with the kernel

2021-03-15 Thread Yury Norov
Remove BITMAP_{FIRST,LAST}_WORD_MASK and introduce BITS_{FIRST,LAST}{,_MASK} as per kernel implementation. Signed-off-by: Yury Norov --- tools/include/linux/bitmap.h | 20 ++-- tools/include/linux/bits.h| 6 ++ tools/lib/bitmap.c| 6

[PATCH 07/13] tools: sync small_const_nbits() macro with the kernel

2021-03-15 Thread Yury Norov
Move the macro from tools/include/asm-generic/bitsperlong.h to tools/include/linux/bitmap.h Signed-off-by: Yury Norov --- tools/include/asm-generic/bitsperlong.h | 3 +++ tools/include/linux/bitmap.h| 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools

[PATCH 09/13] tools: sync find_next_bit implementation

2021-03-15 Thread Yury Norov
Sync the implementation with recent kernel changes. Signed-off-by: Yury Norov --- tools/include/asm-generic/bitops/find.h | 27 ++--- tools/lib/find_bit.c| 52 ++--- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/tools/include

[PATCH 06/13] lib: extend the scope of small_const_nbits() macro

2021-03-15 Thread Yury Norov
find_bit would also benefit from small_const_nbits() optimizations. Signed-off-by: Yury Norov --- include/asm-generic/bitsperlong.h | 9 + include/linux/bitmap.h| 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/bitsperlong.h b

[PATCH 04/13] lib: introduce BITS_{FIRST,LAST} macro

2021-03-15 Thread Yury Norov
8 - -8 Total: Before=26092016, After=26092017, chg +0.00% The compilerr is: aarch64-linux-gnu-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425 Signed-off-by: Yury Norov --- include/linux/bitmap.h | 27 --- include/linux/bits.h

[PATCH 01/13] tools: disable -Wno-type-limits

2021-03-15 Thread Yury Norov
GENMASK(h, l) may be passed with unsigned types. In such case, type-limits warning is generated for example in case of GENMASK(h, 0). Signed-off-by: Yury Norov --- tools/scripts/Makefile.include | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/scripts/Makefile.include b/tools/scripts

[PATCH 02/13] tools: bitmap: sync function declarations with the kernel

2021-03-15 Thread Yury Norov
Some functions in tools/include/linux/bitmap.h declare nbits as int. In the kernel nbits is declared as unsigned int. Signed-off-by: Yury Norov --- tools/include/linux/bitmap.h | 8 tools/lib/bitmap.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH 03/13] arch: rearrange headers inclusion order in asm/bitops for m68k and sh

2021-03-15 Thread Yury Norov
m68k and sh include bitmap/{find,le}.h prior to ffs/fls headers. New fast-path implementation in find.h requires ffs/fls. Reordering the headers inclusion sequence helps to prevent compile-time implicit function declaration error. Signed-off-by: Yury Norov Acked-by: Geert Uytterhoeven --- arch

[PATCH v4 00/13] lib/find_bit: fast path for small bitmaps

2021-03-15 Thread Yury Norov
API. Yury Norov (13): tools: disable -Wno-type-limits tools: bitmap: sync function declarations with the kernel arch: rearrange headers inclusion order in asm/bitops for m68k and sh lib: introduce BITS_{FIRST,LAST} macro tools: sync BITS_MASK macros with the kernel lib: extend the sc

Re: [PATCH 06/14] bitsperlong.h: introduce SMALL_CONST() macro

2021-03-12 Thread Yury Norov
On Fri, Mar 12, 2021 at 10:12:22AM +0100, Rasmus Villemoes wrote: > On 12/03/2021 06.28, Yury Norov wrote: > > On Fri, Feb 19, 2021 at 12:07:27AM +0100, Rasmus Villemoes wrote: > >> On 18/02/2021 05.05, Yury Norov wrote: > >>> Many algorithms become simpler if they ar

Re: [PATCH 06/14] bitsperlong.h: introduce SMALL_CONST() macro

2021-03-11 Thread Yury Norov
On Fri, Feb 19, 2021 at 12:07:27AM +0100, Rasmus Villemoes wrote: > On 18/02/2021 05.05, Yury Norov wrote: > > Many algorithms become simpler if they are passed with relatively small > > input values. One example is bitmap operations when the whole bitmap fits > > into o

Re: [PATCH 04/14] lib: introduce BITS_{FIRST,LAST} macro

2021-03-11 Thread Yury Norov
On Thu, Feb 18, 2021 at 11:51:43PM +0100, Rasmus Villemoes wrote: > On 18/02/2021 05.05, Yury Norov wrote: > > BITMAP_{LAST,FIRST}_WORD_MASK() in linux/bitmap.h duplicates the > > functionality of GENMASK(). The scope of there macros is wider > > than just bitmap. This patch

Re: [RESEND PATCH 1/2] ARM64: enable GENERIC_FIND_FIRST_BIT

2021-03-03 Thread Yury Norov
On Thu, Feb 25, 2021 at 02:02:06PM +, Will Deacon wrote: > On Thu, Feb 25, 2021 at 05:56:59AM -0800, Yury Norov wrote: > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > index 31bd885b79eb..5596eab04092 100644 > > --- a/arch/arm64/Kconfig > > +++ b/arch/

Re: [PATCH 2/2] MIPS: enable GENERIC_FIND_FIRST_BIT

2021-02-25 Thread Yury Norov
On Fri, Feb 26, 2021 at 09:22:18AM +0800, Huacai Chen wrote: > Hi, Yury, > > On Thu, Feb 25, 2021 at 9:59 PM Yury Norov wrote: > > > > From: Alexander Lobakin > > > > MIPS doesn't have architecture-optimized bitsearching functions, > > like find_{first,n

[RESEND PATCH 1/2] ARM64: enable GENERIC_FIND_FIRST_BIT

2021-02-25 Thread Yury Norov
loat-o-meter vmlinux vmlinux.ffb add/remove: 4/1 grow/shrink: 19/251 up/down: 564/-1692 (-1128) ... Overall, GENERIC_FIND_FIRST_BIT=n is harmful both in terms of performance and code size, and it's better to have GENERIC_FIND_FIRST_BIT enabled. Tested-by: Alexey Klimov Signed-off

[PATCH 2/2] MIPS: enable GENERIC_FIND_FIRST_BIT

2021-02-25 Thread Yury Norov
memory (32 R2): add/remove: 4/1 grow/shrink: 1/53 up/down: 216/-372 (-156) Users of for_each_set_bit() like hotpath gic_handle_shared_int() will also benefit from this. Suggested-by: Yury Norov Signed-off-by: Alexander Lobakin Signed-off-by: Yury Norov --- arch/mips/Kconfig | 1 + 1 file changed

[PATCH 0/2] arch: enable GENERIC_FIND_FIRST_BIT for MIPS and ARM64

2021-02-25 Thread Yury Norov
and saves .text memory: Alexander Lobakin (1): MIPS: enable GENERIC_FIND_FIRST_BIT Yury Norov (1): arm64: enable GENERIC_FIND_FIRST_BIT arch/arm64/Kconfig | 1 + arch/mips/Kconfig | 1 + 2 files changed, 2 insertions(+) -- 2.25.1

Re: [PATCH] arm64: enable GENERIC_FIND_FIRST_BIT

2021-02-24 Thread Yury Norov
On Wed, Feb 24, 2021 at 11:52:55AM +, Alexander Lobakin wrote: > From: Yury Norov > Date: Sat, 5 Dec 2020 08:54:06 -0800 > > Hi, > > > ARM64 doesn't implement find_first_{zero}_bit in arch code and doesn't > > enable it in config. It leads to using fi

Re: [PATCH] arm64: enable GENERIC_FIND_FIRST_BIT

2021-02-23 Thread Yury Norov
On Tue, Dec 08, 2020 at 10:35:50AM +, Will Deacon wrote: > On Mon, Dec 07, 2020 at 05:59:16PM -0800, Yury Norov wrote: > > (CC: Alexey Klimov) > > > > On Mon, Dec 7, 2020 at 3:25 AM Will Deacon wrote: > > > > > > On Sat, Dec 05, 2020 at 08:54:06AM

Re: [PATCH v5 0/8] support for bitmap (and hence CPU) list "N" abbreviation

2021-02-22 Thread Yury Norov
in/echo N-N:N/N > cpuset.cpus >root@hackbox:/sys/fs/cgroup/cpuset/foo# cat cpuset.cpus >15 > > This was on a 16 core machine with CONFIG_NR_CPUS=16 in .config file. > > Note that "N" is a dynamic quantity, and can change scope if the bitmap > is changed in

Re: [PATCH 08/14] lib/Kconfig: introduce FAST_PATH option

2021-02-18 Thread Yury Norov
On Thu, Feb 18, 2021 at 05:15:43PM +0200, Andy Shevchenko wrote: > On Wed, Feb 17, 2021 at 08:05:06PM -0800, Yury Norov wrote: > > This series introduces fast paths for find_bit() routines. It is > > beneficial for typical systems, but those who limited in I-cache > > m

Re: [PATCH 14/14] MAINTAINERS: Add entry for the bitmap API

2021-02-18 Thread Yury Norov
On Thu, Feb 18, 2021 at 05:28:32PM +0200, Andy Shevchenko wrote: > On Wed, Feb 17, 2021 at 08:05:12PM -0800, Yury Norov wrote: > > Add myself as maintainer for bitmap API. > > > > I'm an author of current implementation of lib/find_bit and an > > active contributor to

[PATCH 12/14] lib: add fast path for find_first_*_bit() and find_last_bit()

2021-02-17 Thread Yury Norov
Similarly to bitmap functions, users would benefit if we'll handle a case of small-size bitmaps that fit into a single word. While here, move the find_last_bit() declaration to bitops/find.h where other find_*_bit() functions sit. Signed-off-by: Yury Norov --- include/asm-generic/bitops/find.h

[PATCH 13/14] tools: sync lib/find_bit implementation

2021-02-17 Thread Yury Norov
Add fast paths to find_*_bit() functions as per kernel implementation. Signed-off-by: Yury Norov --- tools/include/asm-generic/bitops/find.h | 58 +++-- tools/lib/find_bit.c| 4 +- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/tools

[PATCH 14/14] MAINTAINERS: Add entry for the bitmap API

2021-02-17 Thread Yury Norov
Add myself as maintainer for bitmap API. I'm an author of current implementation of lib/find_bit and an active contributor to lib/bitmap. It was spotted that there's no maintainer for bitmap API. I'm willing to maintain it. Signed-off-by: Yury Norov --- MAINTAINERS | 14 ++ 1 file

[PATCH 11/14] lib: add fast path for find_next_*_bit()

2021-02-17 Thread Yury Norov
17c: d65f03c0ret find_next_bit() call is replaced with 6 instructions. (And I suspect we can improve the GENMASK() for better code generation.) find_next_bit() itself is 41 instructions. Signed-off-by: Yury Norov --- include/asm-generic/bitops/find.h | 30

[PATCH 10/14] tools: sync find_next_bit implementation

2021-02-17 Thread Yury Norov
Sync the implementation with recent kernel changes. Signed-off-by: Yury Norov --- tools/include/asm-generic/bitops/find.h | 27 ++--- tools/lib/find_bit.c| 52 ++--- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/tools/include

[PATCH 09/14] lib: inline _find_next_bit() wrappers

2021-02-17 Thread Yury Norov
lib/find_bit.c declares five single-line wrappers for _find_next_bit(). We may turn those wrappers to inline functions. It eliminates unneeded function calls and opens room for compile-time optimizations. Signed-off-by: Yury Norov --- include/asm-generic/bitops/find.h | 28

[PATCH 08/14] lib/Kconfig: introduce FAST_PATH option

2021-02-17 Thread Yury Norov
that this is the cumulive effect on already existing fast paths controlled by SMALL_CONST() together with ones added by this series. Signed-off-by: Yury Norov --- include/asm-generic/bitsperlong.h | 4 lib/Kconfig | 7 +++ 2 files changed, 11 insertions(+) diff

[PATCH 07/14] tools: introduce SMALL_CONST() macro

2021-02-17 Thread Yury Norov
optimizations of this sort, like find_bit API in the following patches. So it looks helpful to generalize the macro and extend it's visibility. Signed-off-by: Yury Norov --- tools/include/asm-generic/bitsperlong.h | 2 ++ tools/include/linux/bitmap.h| 19 --- 2 files changed, 10

[PATCH 06/14] bitsperlong.h: introduce SMALL_CONST() macro

2021-02-17 Thread Yury Norov
optimizations of this sort, like find_bit API in the following patches. So it looks helpful to generalize the macro and extend it's visibility. Signed-off-by: Yury Norov --- include/asm-generic/bitsperlong.h | 2 ++ include/linux/bitmap.h| 33 ++- 2 files changed, 17

[PATCH 02/14] tools: bitmap: sync function declarations with the kernel

2021-02-17 Thread Yury Norov
Some functions in tools/include/linux/bitmap.h declare nbits as int. In the kernel nbits is declared as unsigned int. Signed-off-by: Yury Norov --- tools/include/linux/bitmap.h | 8 tools/lib/bitmap.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH 01/14] tools: disable -Wno-type-limits

2021-02-17 Thread Yury Norov
GENMASK(h, l) may be passed with unsigned types. In such case, type-limits warning is generated for example in case of GENMASK(h, 0). Signed-off-by: Yury Norov --- tools/scripts/Makefile.include | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/scripts/Makefile.include b/tools/scripts

[PATCH 04/14] lib: introduce BITS_{FIRST,LAST} macro

2021-02-17 Thread Yury Norov
BITMAP_{LAST,FIRST}_WORD_MASK() to avoid duplication and increase the scope of the macros. Signed-off-by: Yury Norov --- include/linux/bitmap.h | 27 --- include/linux/bits.h| 6 ++ include/linux/cpumask.h | 8 include/linux

[PATCH 05/14] tools: sync BITS_MASK macros with the kernel

2021-02-17 Thread Yury Norov
Remove BITMAP_{FIRST,LAST}_WORD_MASK and introduce BITS_{FIRST,LAST}{,_MASK} as per kernel implementation. Signed-off-by: Yury Norov --- tools/include/linux/bitmap.h | 20 ++-- tools/include/linux/bits.h| 6 ++ tools/lib/bitmap.c| 6

[PATCH 03/14] arch: rearrange headers inclusion order in asm/bitops for m68k and sh

2021-02-17 Thread Yury Norov
m68k and sh include bitmap/find.h prior to ffs/fls headers. New fast-path implementation in find.h requires ffs/fls. Reordering the headers inclusion sequence helps to prevent compile-time implicit-function-declaration error. Signed-off-by: Yury Norov Acked-by: Geert Uytterhoeven --- arch/m68k

[PATCH v3 00/14] lib/find_bit: fast path for small bitmaps

2021-02-17 Thread Yury Norov
tps://www.spinics.net/lists/linux-m68k/msg16945.html v3: - split kernel and tools code; - add FAST_PATH config option; - add BITMAP API section to MAINTAINERS. Yury Norov (14): tools: disable -Wno-type-limits tools: bitmap: sync function declarations with the kernel arch: rearrange head

Re: [RESEND PATCH v2 0/6] lib/find_bit: fast path for small bitmaps

2021-02-16 Thread Yury Norov
On Tue, Feb 16, 2021 at 11:14:23AM +0200, Andy Shevchenko wrote: > On Mon, Feb 15, 2021 at 01:30:44PM -0800, Yury Norov wrote: > > [add David Laight ] > > > > On Sat, Jan 30, 2021 at 11:17:11AM -0800, Yury Norov wrote: > > > Bitmap operations are much simpler and f

Re: [RESEND PATCH v2 0/6] lib/find_bit: fast path for small bitmaps

2021-02-15 Thread Yury Norov
[add David Laight ] On Sat, Jan 30, 2021 at 11:17:11AM -0800, Yury Norov wrote: > Bitmap operations are much simpler and faster in case of small bitmaps > which fit into a single word. In linux/bitmap.h we have a machinery that > allows compiler to replace actual function call w

Re: [PATCH 6/8] lib: bitmap: support "N" as an alias for size of bitmap

2021-02-11 Thread Yury Norov
On Wed, Feb 10, 2021 at 06:49:30PM +0200, Andy Shevchenko wrote: > On Wed, Feb 10, 2021 at 10:58:25AM -0500, Paul Gortmaker wrote: > > [Re: [PATCH 6/8] lib: bitmap: support "N" as an alias for size of bitmap] > > On 09/02/2021 (Tue 15:16) Yury Norov wrote: > > &g

Re: [PATCH v4 0/8] support for bitmap (and hence CPU) list "N" abbreviation

2021-02-11 Thread Yury Norov
On Wed, Feb 10, 2021 at 04:23:09PM -0800, Paul E. McKenney wrote: > On Wed, Feb 10, 2021 at 03:50:07PM -0800, Yury Norov wrote: > > On Wed, Feb 10, 2021 at 9:57 AM Paul E. McKenney wrote: > > > > > > On Wed, Feb 10, 2021 at 06:26:54PM +0200, Andy Shevchenko wrote: &

Re: [PATCH v4 0/8] support for bitmap (and hence CPU) list "N" abbreviation

2021-02-10 Thread Yury Norov
On Wed, Feb 10, 2021 at 9:57 AM Paul E. McKenney wrote: > > On Wed, Feb 10, 2021 at 06:26:54PM +0200, Andy Shevchenko wrote: > > On Tue, Feb 09, 2021 at 05:58:59PM -0500, Paul Gortmaker wrote: > > > The basic objective here was to add support for "nohz_full=8-N" and/or > > > "rcu_nocbs="4-N" --

Re: [PATCH 6/8] lib: bitmap: support "N" as an alias for size of bitmap

2021-02-09 Thread Yury Norov
d 47 with "N" and let the system substitute in the actual number at > boot; a number that it knows better than we do. > > Cc: Yury Norov > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Rasmus Villemoes > Cc: Andy Shevchenko > Suggested-by: Yury No

Re: [PATCH 6/8] lib: inline _find_next_bit() wrappers

2021-02-01 Thread Yury Norov
On Mon, Feb 1, 2021 at 5:47 AM Andy Shevchenko wrote: > > On Sat, Jan 30, 2021 at 11:17:17AM -0800, Yury Norov wrote: > > lib/find_bit.c declares five single-line wrappers for _find_next_bit(). > > We may turn those wrappers to inline functions. It eliminates unneeded > >

Re: [PATCH 5/8] bitsperlong.h: introduce SMALL_CONST() macro

2021-02-01 Thread Yury Norov
On Mon, Feb 1, 2021 at 5:45 AM Andy Shevchenko wrote: > > On Sat, Jan 30, 2021 at 11:17:16AM -0800, Yury Norov wrote: > > Many algorithms become simpler if they are passed with relatively small > > input values. One example is bitmap operations when the whole bitmap fits

Re: [PATCH 7/8] lib: add fast path for find_next_*_bit()

2021-02-01 Thread Yury Norov
Jan 30, 2021 at 11:17:18AM -0800, Yury Norov wrote: > > > > Similarly to bitmap functions, find_next_*_bit() users will benefit > > > > if we'll handle a case of bitmaps that fit into a single word. In the > > > > very best case, the compiler may repla

[PATCH 7/8] lib: add fast path for find_next_*_bit()

2021-01-30 Thread Yury Norov
Similarly to bitmap functions, find_next_*_bit() users will benefit if we'll handle a case of bitmaps that fit into a single word. In the very best case, the compiler may replace a function call with a single ffs or ffz instruction. Signed-off-by: Yury Norov --- include/asm-generic/bitops

  1   2   3   4   5   6   7   8   9   10   >