Re: [PATCH v2 02/13] virtio_net: simplify virtnet_set_affinity()

2025-02-11 Thread Yury Norov
Thanks for review and testing, Nick! On Wed, Feb 05, 2025 at 05:00:23PM -0600, Nick Child wrote: > On Tue, Jan 28, 2025 at 11:46:31AM -0500, Yury Norov wrote: > > The inner loop may be replaced with the dedicated for_each_online_cpu_wrap. > > It helps to avoid setting the same bi

Re: distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-10 Thread Yury Norov
On Mon, Feb 10, 2025 at 11:35:48AM -0800, John Hubbard wrote: > On 2/9/25 11:54 PM, Geert Uytterhoeven wrote: > > On Sat, 8 Feb 2025 at 18:53, Yury Norov wrote: > > > On Fri, Feb 07, 2025 at 03:14:01PM -0500, Tamir Duberstein wrote: > > > > On 7/27/24 12:35 AM, Shuah

Re: [PATCH 1/3] bitmap: remove _check_eq_u32_array

2025-02-08 Thread Yury Norov
n OK, 7 years is enough to drop it. Adding in bitmap-for-next for testing. Thanks, Yury > --- > lib/test_bitmap.c | 28 > 1 file changed, 28 deletions(-) > > diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c > index 65a75d58ed9e..c83829ef557f 1

Re: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-08 Thread Yury Norov
nded to be run by both developers and users, but I find > no evidence that bitmap in particular would ever provide additional > value when run by users. This is my evidence: sometimes people report performance or whatever issues on their systems, suspecting bitmaps guilty. I ask them to r

[PATCH v2 02/13] virtio_net: simplify virtnet_set_affinity()

2025-01-28 Thread Yury Norov
The inner loop may be replaced with the dedicated for_each_online_cpu_wrap. It helps to avoid setting the same bits in the @mask more than once, in case of group_size is greater than number of online CPUs. CC: Nick Child Signed-off-by: Yury Norov --- drivers/net/virtio_net.c | 12

Re: [PATCH RFCv2 07/13] iommufd: Implement sw_msi support natively

2025-01-14 Thread Yury Norov
o the msi_msg */ > + if (handle->idev->igroup->sw_msi_start == PHYS_ADDR_MAX) > + return 0; > + > + ictx = handle->idev->ictx; > + guard(mutex)(&ictx->sw_msi_lock); > + /* > + * The input msi_addr is the exact byte offs

[PATCH 02/14] virtio_net: simplify virtnet_set_affinity()

2024-12-28 Thread Yury Norov
The inner loop may be replaced with the dedicated for_each_online_cpu_wrap. It helps to avoid setting the same bits in the @mask more than once, in case of group_size is greater than number of online CPUs. Signed-off-by: Yury Norov --- drivers/net/virtio_net.c | 12 +++- include/linux

Re: [PATCH RFT v12 4/8] fork: Add shadow stack support to clone3()

2024-11-29 Thread Yury Khrustalev
> using more fields from the kernel_clone_args we pass that into the > shadow stack code rather than individual fields. > > Portions of the x86 architecture code were written by Rick Edgecombe. > > Signed-off-by: Mark Brown Acked-by: Yury Khrustalev > @@

Re: [PATCH RFT v12 2/8] Documentation: userspace-api: Add shadow stack API documentation

2024-11-29 Thread Yury Khrustalev
by: Mark Brown > --- > Documentation/userspace-api/index.rst| 1 + > Documentation/userspace-api/shadow_stack.rst | 42 > ++++ > 2 files changed, 43 insertions(+) Acked-by: Yury Khrustalev

Re: [PATCH RFT v11 0/8] fork: Support shadow stacks in clone3()

2024-10-30 Thread Yury Khrustalev
ubstantial question is picking the ABI for > specifying the shadow stack. I will need more time to review this as both my primary and shadow stacks are full with other work. At a glance, I cannot offer any informed opinion for choosing ABI atm. Apologies for the delay. Kind regards, Yury

Re: [PATCH RFT v9 4/8] fork: Add shadow stack support to clone3()

2024-10-03 Thread Yury Khrustalev
ter to the token. My preference would be to avoid having obscure additional arguments that may end up having misleading name or bear some hidden functionality. If kernel is not going to use stack size as such, then users should not have to provide it. Thanks, Yury PS Apologies for delayed reply

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

2023-09-10 Thread Yury Norov
t; > >> Maybe symmetrical change in tools/ like I did[0] an aeon ago? > > > > > > Hmm... Why can't you simply upstream your version? It seems better than > > > mine. > > > > It was a part of the Netlink bigint API which is a bit on hold for

[PATCH] net: sfc: Fix kernel panic introduced by commit 044588b96372 ("sfc: define inner/outer csum offload TXQ types")

2021-04-20 Thread Yury Vostrikov
eue->type, gets NULL back, and crashes. Address this by adding efx_get_tx_queue_by_type() and updating relevant callers. Signed-off-by: Yury Vostrikov --- drivers/net/ethernet/sfc/net_driver.h | 21 ++--- drivers/net/ethernet/sfc/ptp.c| 2 +- drivers/net/ethernet/sfc/t

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 p

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

[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 insert

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

2021-04-19 Thread Yury Norov
reasonable to support it in core bitmap code 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 selecte

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

2021-04-19 Thread Yury Norov
to pass patterns together 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 fil

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: > > > > > > Recent

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() syscall h

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 > avoid bo

[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/a

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 Vill

[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
: 233/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/b

[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-by

[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 kerne

[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
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
p.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/f

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

2021-03-21 Thread Yury Norov
: 233/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/includ

[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 declarations with

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

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

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

2021-03-15 Thread Yury Norov
: 233/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/includ

[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/f

[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

[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
_198c 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/b

[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 a

[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
TMAP 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

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 one wo

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_{fi

[RESEND PATCH 1/2] ARM64: enable GENERIC_FIND_FIRST_BIT

2021-02-25 Thread Yury Norov
scripts/bloat-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 Kli

[PATCH 2/2] MIPS: enable GENERIC_FIND_FIRST_BIT

2021-02-25 Thread Yury Norov
some .text 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 fi

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

2021-02-25 Thread Yury Norov
imized code 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 t

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
> This change would enable sysadmins to have a common bootarg across all > such systems, and would also avoid any off-by-one fencepost errors that > happen for users who might briefly forget that core counts start at zero. > > Originally I did this at the CPU subsys level, but Yu

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 contribut

[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/f

[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 +++

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

2021-02-17 Thread Yury Norov
/ #64 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

[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 change

[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 change

[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

  1   2   3   4   5   6   7   8   9   10   >