Re: [PATCH 3/9] all: replace bitmap_weigth() with bitmap_{empty,full,eq,gt,le}

2021-11-28 Thread Greg Kroah-Hartman
On Sat, Nov 27, 2021 at 07:56:58PM -0800, Yury Norov wrote: > bitmap_weight() counts all set bits in the bitmap unconditionally. > However in some cases we can traverse a part of bitmap when we > only need to check if number of set bits is greater, less or equal > to some number. > > This patch re

Re: [PATCH 0/9] lib/bitmap: optimize bitmap_weight() usage

2021-11-28 Thread Nicholas Piggin
Excerpts from Yury Norov's message of November 28, 2021 1:56 pm: > In many cases people use bitmap_weight()-based functions like this: > > if (num_present_cpus() > 1) > do_something(); > > This may take considerable amount of time on many-cpus machines because > num_present_cp

Re: [PATCH 7/9] lib/cpumask: add num_{possible,present,active}_cpus_{eq,gt,le}

2021-11-28 Thread Joe Perches
On Sat, 2021-11-27 at 19:57 -0800, Yury Norov wrote: > Add num_{possible,present,active}_cpus_{eq,gt,le} and replace num_*_cpus() > with one of new functions where appropriate. This allows num_*_cpus_*() > to return earlier depending on the condition. [] > diff --git a/arch/arc/kernel/smp.c b/arch/

Re: [PATCH 7/9] lib/cpumask: add num_{possible,present,active}_cpus_{eq,gt,le}

2021-11-28 Thread Yury Norov
On Sun, Nov 28, 2021 at 09:07:52AM -0800, Joe Perches wrote: > On Sat, 2021-11-27 at 19:57 -0800, Yury Norov wrote: > > Add num_{possible,present,active}_cpus_{eq,gt,le} and replace num_*_cpus() > > with one of new functions where appropriate. This allows num_*_cpus_*() > > to return earlier depend

Re: [PATCH 7/9] lib/cpumask: add num_{possible,present,active}_cpus_{eq,gt,le}

2021-11-28 Thread Dennis Zhou
Hello, On Sun, Nov 28, 2021 at 09:43:20AM -0800, Yury Norov wrote: > On Sun, Nov 28, 2021 at 09:07:52AM -0800, Joe Perches wrote: > > On Sat, 2021-11-27 at 19:57 -0800, Yury Norov wrote: > > > Add num_{possible,present,active}_cpus_{eq,gt,le} and replace num_*_cpus() > > > with one of new function

Re: [PATCH 7/9] lib/cpumask: add num_{possible, present, active}_cpus_{eq, gt, le}

2021-11-28 Thread Emil Renner Berthing
On Sun, 28 Nov 2021 at 18:43, Yury Norov wrote: > On Sun, Nov 28, 2021 at 09:07:52AM -0800, Joe Perches wrote: > > On Sat, 2021-11-27 at 19:57 -0800, Yury Norov wrote: > > > Add num_{possible,present,active}_cpus_{eq,gt,le} and replace num_*_cpus() > > > with one of new functions where appropriate

Re: [PATCH 7/9] lib/cpumask: add num_{possible,present,active}_cpus_{eq,gt,le}

2021-11-28 Thread Joe Perches
On Sun, 2021-11-28 at 09:43 -0800, Yury Norov wrote: > On Sun, Nov 28, 2021 at 09:07:52AM -0800, Joe Perches wrote: > > On Sat, 2021-11-27 at 19:57 -0800, Yury Norov wrote: > > > Add num_{possible,present,active}_cpus_{eq,gt,le} and replace num_*_cpus() > > > with one of new functions where appropr

Re: [PATCH 7/9] lib/cpumask: add num_{possible,present,active}_cpus_{eq,gt,le}

2021-11-28 Thread Yury Norov
On Sun, Nov 28, 2021 at 12:54:00PM -0500, Dennis Zhou wrote: > Hello, > > On Sun, Nov 28, 2021 at 09:43:20AM -0800, Yury Norov wrote: > > On Sun, Nov 28, 2021 at 09:07:52AM -0800, Joe Perches wrote: > > > On Sat, 2021-11-27 at 19:57 -0800, Yury Norov wrote: > > > > Add num_{possible,present,active

Re: [PATCH 0/9] lib/bitmap: optimize bitmap_weight() usage

2021-11-28 Thread Yury Norov
On Sun, Nov 28, 2021 at 09:08:41PM +1000, Nicholas Piggin wrote: > Excerpts from Yury Norov's message of November 28, 2021 1:56 pm: > > In many cases people use bitmap_weight()-based functions like this: > > > > if (num_present_cpus() > 1) > > do_something(); > > > > This may take

Re: [PATCH 0/9] lib/bitmap: optimize bitmap_weight() usage

2021-11-28 Thread Yury Norov
On Sun, Nov 28, 2021 at 07:03:41PM +0100, mirq-t...@rere.qmqm.pl wrote: > On Sat, Nov 27, 2021 at 07:56:55PM -0800, Yury Norov wrote: > > In many cases people use bitmap_weight()-based functions like this: > > > > if (num_present_cpus() > 1) > > do_something(); > > > > This may ta