bitmap_empty() in pnv_ioda_pick_m64_pe() is O(N) and useless, because
the following find_next_bit() does the same work.
Drop it, and while there replace a while() loop with the dedicated
for_each_set_bit().
Signed-off-by: Yury Norov
---
arch/powerpc/platforms/powernv/pci-ioda.c | 18
On Thu, Jun 26, 2025 at 12:41:06AM +0530, Shrikanth Hegde wrote:
> Checking if a CPU is avoid can add a slight overhead and should be
> done only when necessary.
>
> Add a static key check which makes it almost nop when key is false.
> Arch needs to set the key when it decides to. Refer to debu
On Thu, Jun 26, 2025 at 12:41:03AM +0530, Shrikanth Hegde wrote:
> Load balancer shouldn't spread CFS tasks into a CPU marked as Avoid.
> Remove those CPUs from load balancing decisions.
>
> At wakeup, don't select a CPU marked as avoid.
>
> Signed-off-by: Shrikanth Hegde
> ---
> while tesing
On Thu, Jun 26, 2025 at 12:41:08AM +0530, Shrikanth Hegde wrote:
> Reference patch for how an architecture can make use of this infra.
>
> This is not meant to be merged. Instead the vp_manual_hint should either
> come from hardware or could be derived using steal time.
If you don't add any cod
On Thu, Jun 26, 2025 at 12:40:59AM +0530, Shrikanth Hegde wrote:
> This is a followup version if [1] with few additions. This is still an RFC
> and would like get feedback on the idea and suggestions on improvement.
>
> v1->v2:
> - Renamed to cpu_avoid_mask in place of cpu_parked_mask.
This one
On Fri, Mar 21, 2025 at 12:53:36PM -0400, Tamir Duberstein wrote:
> Hi all, now that the printf and scanf series have been taken via kees'
> tree[0] and sent in for v6.15-rc1[1], I wonder if we'd like to revisit
> this discussion.
>
> As I understand it, the primary objections to moving bitmap to
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
On Fri, Feb 07, 2025 at 03:14:02PM -0500, Tamir Duberstein wrote:
> This has been unused since commit 3aa56885e516 ("bitmap: replace
> bitmap_{from,to}_u32array") in 2018. Remove it to avoid the need to port
> it to KUnit in this series.
>
> Signed-off-by: Tamir Duberstein
OK, 7 years is enough
On Fri, Feb 07, 2025 at 03:14:01PM -0500, Tamir Duberstein wrote:
> This is one of just 3 remaining "Test Module" kselftests (the others
> being printf and scanf), the rest having been converted to KUnit.
>
> I tested this using:
>
> $ tools/testing/kunit/kunit.py run --arch arm64 --make_options
off-by: Yury Norov
---
drivers/net/ethernet/ibm/ibmvnic.c | 18 +++---
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
b/drivers/net/ethernet/ibm/ibmvnic.c
index e95ae0d39948..bef18ff69065 100644
--- a/drivers/net/ethernet/ibm/ibmvni
one by one.
No functional changes were intended.
Signed-off-by: Yury Norov
---
arch/s390/kernel/processor.c| 2 +-
drivers/pci/controller/pci-hyperv.c | 2 +-
drivers/scsi/lpfc/lpfc_init.c | 2 +-
include/linux/cpumask.h | 4 ++--
kernel/padata.c | 2
ouple of places kernel users opencode missing cpumask_next_and_wrap().
Add it as well.
CC: Alexander Gordeev
CC: Bjorn Helgaas
Signed-off-by: Yury Norov
---
include/linux/cpumask.h | 38 ++
1 file changed, 38 insertions(+)
diff --git a/include/linux/cpum
The function opencodes for_each_cpu_wrap() macro. As a loop termination
condition it uses cpumask_empty(), which is O(N), and it makes the whole
algorithm O(N^2). Switching to for_each_cpu_wrap() simplifies the logic,
and makes the algorithm linear.
Signed-off-by: Yury Norov
---
arch/powerpc
il.com/T/
v2:
- rebase on top of today's origin/master;
- drop #v1-10: not needed since v6.14 @ Sagi Grinberg;
- #2, #3: fix picking next unused CPU @ Nick Child;
- fix typos, cleanup comments @ Bjorn Helgaas, Alexander Gordeev;
- CC Christoph Hellwig for the whole series.
Yury Norov
On Fri, Jan 03, 2025 at 11:44:32AM -0600, Bjorn Helgaas wrote:
> On Sat, Dec 28, 2024 at 10:49:38AM -0800, Yury Norov wrote:
> > cpumask_next_wrap_old() has two additional parameters, comparing to it's
> > analogue in linux/find.h find_next_bit_wrap(). The reason for that is
&g
On Tue, Jan 07, 2025 at 02:28:31PM +0100, Alexander Gordeev wrote:
> On Sat, Dec 28, 2024 at 10:49:38AM -0800, Yury Norov wrote:
>
> Hi Yury,
>
> > cpumask_next_wrap_old() has two additional parameters, comparing to it's
> > analogue in linux/find.h find_next_bit_w
On Tue, Jan 07, 2025 at 02:43:01PM -0800, Yury Norov wrote:
> On Tue, Jan 07, 2025 at 04:37:17PM -0600, Nick Child wrote:
> > On Sat, Dec 28, 2024 at 10:49:35AM -0800, Yury Norov wrote:
> > > A loop based on cpumask_next_wrap() opencodes the dedicated macro
> > > for_ea
On Tue, Jan 07, 2025 at 04:37:17PM -0600, Nick Child wrote:
> On Sat, Dec 28, 2024 at 10:49:35AM -0800, Yury Norov wrote:
> > A loop based on cpumask_next_wrap() opencodes the dedicated macro
> > for_each_online_cpu_wrap(). Using the macro allows to avoid setting
> > bits af
On Fri, Jan 03, 2025 at 08:02:29AM +0100, Christoph Hellwig wrote:
> You've sent me less than a handfull of 14 patches, there's no way
> to properly review this.
Hi Christoph,
You can find the whole series here:
https://lore.kernel.org/linux-scsi/cabprks-uqfjmdp5ps+hsnvzggdmv0bnawpsvnpy4au4v+ud.
wrap().
In a couple places kernel users opencode missing cpumask_next_and_wrap().
Add it as well.
Signed-off-by: Yury Norov
---
include/linux/cpumask.h | 37 +
1 file changed, 37 insertions(+)
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.
The function opencodes for_each_cpu_wrap() macro. As a loop termination
condition it uses cpumask_empty(), which is O(N), and it makes the whole
algorithm O(N^2). Switching to for_each_cpu_wrap() simplifies the logic,
and makes the algorithm linear.
Signed-off-by: Yury Norov
---
arch/powerpc
implementation one by one.
No functional changes were intended.
Signed-off-by: Yury Norov
---
arch/s390/kernel/processor.c| 2 +-
drivers/nvme/host/tcp.c | 2 +-
drivers/pci/controller/pci-hyperv.c | 2 +-
drivers/scsi/lpfc/lpfc_init.c | 2 +-
include/linux/cpumask.h
A loop based on cpumask_next_wrap() opencodes the dedicated macro
for_each_online_cpu_wrap(). Using the macro allows to avoid setting
bits affinity mask more than once when stride >= num_online_cpus.
This also helps to drop cpumask handling code in the caller function.
Signed-off-by: Yury No
er-letter and
key patches #5 and 6 to every person involved. All other patches are sent
individually to those pointed by scripts/get_maintainers.pl.
I'd like to move the series with my bitmap-for-next branch as a whole.
Yury Norov (14):
objpool: rework objpool_pop()
virtio_net: simplify vi
On Thu, Jun 20, 2024 at 12:26:18PM -0700, Linus Torvalds wrote:
> On Thu, 20 Jun 2024 at 11:32, Yury Norov wrote:
> >
> > Is that in master already? I didn't get any email, and I can't find
> > anything related in the master branch.
>
> It's 5d272dd1b
On Thu, Jun 20, 2024 at 11:00:38AM -0700, Linus Torvalds wrote:
> On Thu, 20 Jun 2024 at 10:57, Yury Norov wrote:
> >
> >
> > The typical lock-protected bit allocation may look like this:
>
> If it looks like this, then nobody cares. Clearly the user in question
&
C: Bart Van Assche
CC: Sergey Shtylyov
Signed-off-by: Yury Norov
---
MAINTAINERS | 1 +
include/linux/find.h| 4 -
include/linux/find_atomic.h | 324
lib/find_bit.c | 86 ++
4 files changed, 411 insertions(+),
Add basic functionality test for new API.
Signed-off-by: Yury Norov
---
lib/test_bitmap.c | 62 +++
1 file changed, 62 insertions(+)
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
index 65a75d58ed9e..405f79dd2266 100644
--- a/lib/test_bitmap.c
move new API to separate headers, to not bloat bitmap.h @ Linus;
- patch #1: adjust comments to allow returning >= @size;
- rebase the series on top of current master.
Yury Norov (40):
lib/find: add atomic find_bit() primitives
lib/find: add test for atomic find_bit() ops
l
The code operates on individual bits of the bitmap, and leveraging
atomic find ops we can drop locking scheme around the map.
Signed-off-by: Yury Norov
---
arch/powerpc/sysdev/xive/spapr.c | 34 ++--
1 file changed, 6 insertions(+), 28 deletions(-)
diff --git a/arch
The driver operates on individual bits of the kvmppc_uvmem_bitmap.
Now that we have an atomic search API for bitmaps, we can rely on
it and drop locking around the bitmap entirely.
Signed-off-by: Yury Norov
---
arch/powerpc/kvm/book3s_hv_uvmem.c | 33 ++
1 file
Use find_and_{set,clear}_bit() where appropriate and simplify the logic.
Signed-off-by: Yury Norov
---
arch/powerpc/mm/book3s32/mmu_context.c | 11 +++---
arch/powerpc/platforms/pasemi/dma_lib.c| 46 ++
arch/powerpc/platforms/powernv/pci-sriov.c | 13 ++
3 files
On Thu, Mar 7, 2024, 2:31 AM Herve Codina wrote:
> Hi Yury,
>
> On Wed, 6 Mar 2024 15:39:06 +0200
> Andy Shevchenko wrote:
>
> > On Wed, Mar 06, 2024 at 05:11:19AM -0800, Yury Norov wrote:
> > > On Wed, Mar 06, 2024 at 09:07:19AM +0100, Herve Codina wrote:
>
On Wed, Mar 06, 2024 at 09:07:17AM +0100, Herve Codina wrote:
> The QMC HDLC driver provides support for HDLC using the QMC (QUICC
> Multichannel Controller) to transfer the HDLC data.
>
> Signed-off-by: Herve Codina
> Reviewed-by: Christophe Leroy
> Acked-by: Jakub Kicinski
> Reviewed-by: Andy
t; bitmap_gather() can the seen as the reverse bitmap_scatter() operation.
>
> Signed-off-by: Andy Shevchenko
> Link:
> https://lore.kernel.org/lkml/20230926052007.3917389-3-andriy.shevche...@linux.intel.com/
> Co-developed-by: Herve Codina
> Signed-off-by: Herve Codina
Signed
On Wed, Mar 06, 2024 at 09:07:20AM +0100, Herve Codina wrote:
> QMC channels support runtime timeslots changes but nothing is done at
> the QMC HDLC driver to handle these changes.
>
> Use existing IFACE ioctl in order to configure the timeslots to use.
>
> Signed-off-by: Herve Codina
> Reviewed
On Thu, Feb 22, 2024 at 05:49:59PM +0100, Herve Codina wrote:
> Hi Andy, Yury,
>
> On Thu, 22 Feb 2024 17:39:27 +0200
> Andy Shevchenko wrote:
>
> ...
> > > + * bitmap_scatter() for the bitmap scatter detailed operations).
> >
> > > + * Suppose scattered computed using bitmap_scatter(scattere
On Mon, Feb 12, 2024 at 04:36:36PM +0200, Andy Shevchenko wrote:
> On Mon, Feb 12, 2024 at 03:20:22PM +0100, Herve Codina wrote:
> > On Mon, 12 Feb 2024 16:01:38 +0200
> > Andy Shevchenko wrote:
>
> ...
>
> > Agree, the bitmap_onto() code is simpler to understand than its help.
> >
> > I introd
On Mon, Feb 12, 2024 at 10:37:18AM -0800, Yury Norov wrote:
> On Mon, Feb 12, 2024 at 08:56:32AM +0100, Herve Codina wrote:
> > The bitmap_onto() function translates one bitmap relative to another but
> > no function are present to perform the reverse translation.
> >
>
On Mon, Feb 12, 2024 at 08:56:32AM +0100, Herve Codina wrote:
> The bitmap_onto() function translates one bitmap relative to another but
> no function are present to perform the reverse translation.
>
> Introduce bitmap_off() to fill this hole.
>
> Signed-off-by: Herve Codina
> ---
> include/li
On Wed, Jan 24, 2024 at 09:19:00AM -0800, Lameter, Christopher wrote:
> On Tue, 23 Jan 2024, Huang Shijie wrote:
>
> > During the kernel booting, the generic cpu_to_node() is called too early in
> > arm64, powerpc and riscv when CONFIG_NUMA is enabled.
> >
> > For arm64/powerpc/riscv, there are a
On Fri, Jan 19, 2024 at 04:50:53PM +0800, Shijie Huang wrote:
>
> 在 2024/1/19 16:42, Mike Rapoport 写道:
> > On Fri, Jan 19, 2024 at 02:46:16PM +0800, Shijie Huang wrote:
> > > 在 2024/1/19 12:42, Yury Norov 写道:
> > > > This adds another level of indirectio
On Fri, Jan 19, 2024 at 11:32:27AM +0800, Huang Shijie wrote:
> hZ7bkEvc+Z19RHkS/HVG3KMg
> X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR01MB7144
> Status: O
> Content-Length: 3779
> Lines: 126
>
> During the kernel booting, the generic cpu_to_node() is called too early in
> arm64, power
On Mon, Dec 11, 2023 at 06:27:14PM -0800, Yury Norov wrote:
> Add helpers around test_and_{set,clear}_bit() that allow to search for
> clear or set bits and flip them atomically.
>
> The target patterns may look like this:
>
> for (idx = 0; idx < nbits; idx+
tion with 'for_each'.
CC: Bart Van Assche
CC: Sergey Shtylyov
Signed-off-by: Yury Norov
---
include/linux/find.h | 293 +++
lib/find_bit.c | 85 +
2 files changed, 378 insertions(+)
diff --git a/include/linux/find.h b/include
Add basic functionality test for new API.
Signed-off-by: Yury Norov
---
lib/test_bitmap.c | 61 +++
1 file changed, 61 insertions(+)
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
index 65f22c2578b0..277e1ca9fd28 100644
--- a/lib/test_bitmap.c
@ Vitaly Kuznetsov, Sean Christopherson;
Yury Norov (35):
lib/find: add atomic find_bit() primitives
lib/find: add test for atomic find_bit() ops
lib/sbitmap; optimize __sbitmap_get_word() by using find_and_set_bit()
watch_queue: optimize post_one_notification() by using
find_and_
Use find_and_{set,clear}_bit() where appropriate and simplify the logic.
Signed-off-by: Yury Norov
---
arch/powerpc/mm/book3s32/mmu_context.c | 10 ++---
arch/powerpc/platforms/pasemi/dma_lib.c| 45 +-
arch/powerpc/platforms/powernv/pci-sriov.c | 12 ++
3 files
On Mon, Dec 04, 2023 at 07:51:01PM +0100, Jan Kara wrote:
> Hello Yury!
>
> On Sun 03-12-23 11:23:47, Yury Norov wrote:
> > Add helpers around test_and_{set,clear}_bit() that allow to search for
> > clear or set bits and flip them atomically.
> >
> > The t
Add basic functionality test for new API.
Signed-off-by: Yury Norov
---
lib/test_bitmap.c | 61 +++
1 file changed, 61 insertions(+)
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
index 65f22c2578b0..277e1ca9fd28 100644
--- a/lib/test_bitmap.c
or_each'.
All users of find_bit() API, where heavy concurrency is expected,
are encouraged to switch to atomic find_and_bit() as appropriate.
CC: Bart Van Assche
CC: Sergey Shtylyov
Signed-off-by: Yury Norov
---
include/linux/find.h | 293 +++
lib/fin
atch #13: keep test against stimer->config.enable @ Vitaly Kuznetsov;
- Patch #15: use find_and_set_next_bit @ Bart Van Assche;
- Patch #31: edit commit message @ Tony Lu, Alexandra Winter;
- Patch #35: edit tag @ John Paul Adrian Glaubitz;
Yury Norov (35):
lib/find: add atomic find_bit() primi
Use find_and_{set,clear}_bit() where appropriate and simplify the logic.
Signed-off-by: Yury Norov
---
arch/powerpc/mm/book3s32/mmu_context.c | 10 ++---
arch/powerpc/platforms/pasemi/dma_lib.c| 45 +-
arch/powerpc/platforms/powernv/pci-sriov.c | 12 ++
3 files
nel. They can be applied
separately from each other on per-subsystems basis, or I can pull them
in bitmap tree, as appropriate.
[1]
https://lore.kernel.org/lkml/634f5fdf-e236-42cf-be8d-48a581c21...@alu.unizg.hr/T/#m3e7341eb3571753f3acf8fe166f3fb5b2c12e615
Yury Norov (34):
lib/find: add atom
h'.
All users of find_bit() API, where heavy concurrency is expected,
are encouraged to switch to atomic find_and_bit() as appropriate.
Signed-off-by: Yury Norov
---
include/linux/find.h | 289 +++
lib/find_bit.c | 85 +
2 files chan
Fix opencoded find_and_{set,clear}_bit() by using dedicated functions.
Signed-off-by: Yury Norov
---
arch/powerpc/mm/book3s32/mmu_context.c | 10 ++---
arch/powerpc/platforms/pasemi/dma_lib.c| 45 +-
arch/powerpc/platforms/powernv/pci-sriov.c | 12 ++
3 files
Use node_has_cpus() as more efficient alternative to nr_cpus_node()
where possible.
Signed-off-by: Yury Norov
---
arch/powerpc/platforms/cell/spu_priv1_mmio.c | 2 +-
arch/powerpc/platforms/cell/spufs/sched.c| 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc
that.
Signed-off-by: Yury Norov
---
include/linux/topology.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/topology.h b/include/linux/topology.h
index fea32377f7c7..7e0d8f8f5a39 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -39,9
id cpu range"."),
> will generate a warning when DEBUG_PER_CPU_MAPS is enabled each time
> /proc/cpuinfo is read. Future-proof cpuinfo by checking its input to
> cpumask_next() is valid.
>
> Signed-off-by: Andrew Jones
> Cc: Yury Norov
Reviewed-by: Yury Norov
> ---
On Thu, Nov 03, 2022 at 05:49:06PM +0100, Borislav Petkov wrote:
> On Thu, Nov 03, 2022 at 09:30:54AM -0700, yury.no...@gmail.com wrote:a
> > Callers should pass sane arguments into internal functions if they
> > expect sane output.
>
> What internal function? It's in a global header.
>
> > The A
On Thu, Nov 03, 2022 at 04:34:04PM +0100, Andrew Jones wrote:
> On Thu, Nov 03, 2022 at 04:02:12PM +0100, Borislav Petkov wrote:
> > On Thu, Nov 03, 2022 at 01:59:45PM +0100, Andrew Jones wrote:
> > > The patch I'm proposing ensures cpumask_next()'s range, which is actually
> > > [-1, nr_cpus_ids -
On Fri, Oct 28, 2022, 10:03 AM Borislav Petkov wrote:
> On Fri, Oct 28, 2022 at 07:46:08AM -0700, Yury Norov wrote:
> > I'll take it in bitmap-for-next this weekend.
>
> Why?
Because it's related to bitmap API usage and has been revealed after some
work in bitmaps.
On Fri, Oct 28, 2022 at 09:48:28AM +0200, Andrew Jones wrote:
> Hi x86 maintainers,
>
> I realize 78e5a3399421 has now been reverted, so this fix is no longer
> urgent. I don't believe it's wrong, though, so if it's still of interest,
> then please consider this a friendly ping.
>
> Thanks,
> dre
t; While the patches are being posted together in a series since they're
> for two different architectures they don't necessarily need to go
> through the same tree.
Acked-by: Yury Norov
ome treewide-cleanup
> experience might share some wisdom about what the best timing usually
> winds up being, I'm all ears.
>
> Please take a look! The number of lines touched is quite small, so this
> should be reviewable, and as much as is possible has been pushed into
>
of:
[1]
https://lore.kernel.org/lkml/20220905230820.3295223-4-yury.no...@gmail.com/T/#m96ffe122721893471fd3470d911a8f2fad6d03b3
Reported-by: Stephen Rothwell
Signed-off-by: Yury Norov
---
v2: move "lwz r7,0(r7)" under #else conditional.
arch/powerpc/kernel/head_64.S | 4
1 file chang
On Wed, Sep 21, 2022 at 08:20:06AM +1000, Stephen Rothwell wrote:
> Hi Yury,
>
> On Tue, 20 Sep 2022 08:29:35 -0700 Yury Norov wrote:
> >
>
> > diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
> > index cf2c08902c05..7cb97881635e 100644
of:
[1]
https://lore.kernel.org/lkml/20220905230820.3295223-4-yury.no...@gmail.com/T/#m96ffe122721893471fd3470d911a8f2fad6d03b3
Reported-by: Stephen Rothwell
Signed-off-by: Yury Norov
---
arch/powerpc/kernel/head_64.S | 4
1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/kernel/head_64.S
kefile.build:465: arch/powerpc/kernel] Fehler 2
> make: *** [Makefile:1855: arch/powerpc] Error 2
>
> Change the DISABLE_LATENT_ENTROPY_PLUGIN flags to undefine
> LATENT_ENTROPY_PLUGIN for files where the plugin is disabled.
>
> Cc: Yury Norov
> Cc: Emese Revfy
> Fixes: 36d4b36b6959 (&qu
Commit 36d4b36b69590 (lib/nodemask: inline next_node_in() and
node_random()) removed the lib/nodemask.c file, but the remove
didn't happen when the patch was applied.
Reported-by: "Aneesh Kumar K.V"
Signed-off-by: Yury Norov
---
lib/nodemask.c | 23 ---
1 f
On Fri, Aug 12, 2022 at 10:46:57AM +0530, Aneesh Kumar K.V wrote:
> Yury Norov writes:
>
> > The functions are pretty thin wrappers around find_bit engine, and
> > keeping them in c-file prevents compiler from small_const_nbits()
> > optimization, which must take pl
On Tue, Jul 26, 2022 at 04:57:38PM +1000, Michael Ellerman wrote:
> Yury Norov writes:
> > On Mon, Jul 25, 2022 at 09:28:12AM +0200, Andy Shevchenko wrote:
> >> On Sun, Jul 24, 2022 at 12:19 AM Yury Norov wrote:
> >> >
> >> > archrandom.h includes to
On Mon, Jul 25, 2022 at 11:39:39PM +0200, Andy Shevchenko wrote:
> On Mon, Jul 25, 2022 at 6:19 PM Yury Norov wrote:
> > On Mon, Jul 25, 2022 at 09:28:12AM +0200, Andy Shevchenko wrote:
> > > On Sun, Jul 24, 2022 at 12:19 AM Yury Norov wrote:
>
> ...
>
> > &g
On Mon, Jul 25, 2022 at 10:22:13PM +1000, Michael Ellerman wrote:
> Michael Ellerman writes:
> > Yury Norov writes:
> >> archrandom.h includes to refer ppc_md. This causes
> >> circular header dependency, if generic nodemask.h includes random.h:
> >>
>
On Mon, Jul 25, 2022 at 09:28:12AM +0200, Andy Shevchenko wrote:
> On Sun, Jul 24, 2022 at 12:19 AM Yury Norov wrote:
> >
> > archrandom.h includes to refer ppc_md. This causes
> > circular header dependency, if generic nodemask.h includes random.h:
> >
> > In
On top of g...@github.com:/norov/linux.git bitmap-for-next.
There are just 2 functions in nodemask.c, both are thin wrappers around
bitmap API. 1st patch of this series drops dependency on in archrandom.h
lib/nodemask: inline next_node_in() and node_random()
MAINTAINERS
,
from arch/powerpc/kernel/asm-offsets.c:12:
include/linux/sched.h:1203:9: error: unknown type name 'nodemask_t'
1203 | nodemask_t mems_allowed;
| ^~
Fix it by removing dependency from archrandom.h
Signed-off-by: Yury Norov
p the kernel size:
add/remove: 1/2 grow/shrink: 9/5 up/down: 968/-88 (880)
CC: Andy Shevchenko
CC: Rasmus Villemoes
Signed-off-by: Yury Norov
---
MAINTAINERS | 1 -
include/linux/nodemask.h | 27 ++-
lib/Makefile | 2 +-
lib/nodem
qman_test_stash() calls cpumask_weight() to compare the weight of cpumask
with a given number. We can do it more efficiently with cpumask_weight_lt
because conditional cpumask_weight may stop traversing the cpumask earlier,
as soon as condition is (or can't be) met.
Signed-off-by: Yury
PowerPC code uses cpumask_weight() to compare the weight of cpumask with
a given number. We can do it more efficiently with cpumask_weight_{eq, ...}
because conditional cpumask_weight may stop traversing the cpumask earlier,
as soon as condition is (or can't be) met.
Signed-off-by: Yury
qman_test_stash() calls cpumask_weight() to compare the weight of
cpumask with a given number. We can do it more efficiently with
cpumask_weight_lt because conditional cpumask_weight may stop
traversing the cpumask earlier, as soon as condition is met.
Signed-off-by: Yury Norov
---
drivers/soc
PowerPC code uses cpumask_weight() to compare the weight of cpumask
with a given number. We can do it more efficiently with
cpumask_weight_{eq, ...} because conditional cpumask_weight may stop
traversing the cpumask earlier, as soon as condition is met.
Signed-off-by: Yury Norov
---
arch
On Sat, Dec 18, 2021 at 2:16 PM Michał Mirosław wrote:
>
> On Sat, Dec 18, 2021 at 01:19:57PM -0800, Yury Norov wrote:
> > Don't call bitmap_weight() if the following code can get by
> > without it.
> >
> > Signed-off-by: Yury Norov
> > ---
> >
cpumask and nodemask APIs are thin wrappers around basic bitmap API, and
corresponding files are not formally maintained. This patch adds them to
BITMAP_API section, so that bitmap folks would have closer look at it.
Signed-off-by: Yury Norov
---
MAINTAINERS | 4
1 file changed, 4
Pull bitmap_weight_{cmp,eq,gt,ge,lt,le} from mother kernel and
use where applicable.
Signed-off-by: Yury Norov
---
tools/include/linux/bitmap.h | 44
tools/lib/bitmap.c | 20
tools/perf/util/pmu.c| 2 +-
3 files changed
: Yury Norov
---
include/linux/cpumask.h | 26 +++---
kernel/cpu.c| 15 +++
2 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index c2a9d15e2cbd..0add872898f8 100644
--- a/include/linux
-by: Yury Norov
---
include/linux/cpumask.h | 25 +++--
kernel/cpu.c| 16
2 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 0be2504d8e4c..c2a9d15e2cbd 100644
--- a/include/linux
Piggin
Signed-off-by: Yury Norov
---
include/linux/cpumask.h | 30 --
kernel/cpu.c| 22 ++
2 files changed, 38 insertions(+), 14 deletions(-)
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 1906e3225737..0be2504d8e4c
cpu_online_mask has an associate counter of online cpus, which should be
initialized in init_cpu_online()
Fixes: 0c09ab96fc82010 (cpu/hotplug: Cache number of online CPUs)
Signed-off-by: Yury Norov
---
kernel/cpu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/cpu.c b/kernel/cpu.c
-by: Yury Norov
---
include/linux/nodemask.h | 5 +
mm/page_alloc.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 197598e075e9..c5014dbf3cce 100644
--- a/include/linux/nodemask.h
+++ b/include/linux
Kernel code calls nodes_weight() to compare the weight of nodemask with
a given number. We can do it more efficiently with nodes_weight_{eq, ...}
because conditional nodes_weight may stop traversing the nodemask earlier,
as soon as condition is met.
Signed-off-by: Yury Norov
---
drivers/acpi
Kernel code calls cpumask_weight() to compare the weight of cpumask with
a given number. We can do it more efficiently with cpumask_weight_{eq, ...}
because conditional cpumask_weight may stop traversing the cpumask earlier,
as soon as condition is met.
Signed-off-by: Yury Norov
---
arch/ia64
conditional versions where possible,
except for small bitmaps which size is not configurable and known at
constant time. In that case conditional version of bitmap_weight would not
benefit due to small_const_nbits() optimization; but readability may
suffer.
Signed-off-by: Yury Norov
---
arch/x86/kernel
ier.
This patch adds new bitmap_weight_cmp() as suggested by Michał Mirosław
and a family of eq, gt, ge, lt and le wrappers to allow this optimization.
The following patches apply new functions where appropriate.
Suggested-by: "Michał Mirosław" (for
bitmap_weight_cmp)
Signed-off-b
Kernel code calls nodes_weight() to check if any bit of a given nodemask is
set. We can do it more efficiently with nodes_empty() because nodes_empty()
stops traversing the nodemask as soon as it finds first set bit, while
nodes_weight() counts all bits unconditionally.
Signed-off-by: Yury Norov
.
Signed-off-by: Yury Norov
---
arch/alpha/kernel/process.c| 2 +-
arch/ia64/kernel/setup.c | 2 +-
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 14 +++---
arch/x86/mm/mmio-mod.c | 2 +-
arch/x86/platform/uv/uv_nmi.c | 2 +-
drivers/cpufreq/qcom
ff-by: Yury Norov
---
arch/nds32/kernel/perf_event_cpu.c | 2 +-
arch/x86/kvm/hyperv.c | 8
drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c| 2 +-
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c| 4 ++--
driver
Mellanox driver has an open-coded for_each_set_bit(). Fix it.
Signed-off-by: Yury Norov
---
drivers/net/ethernet/mellanox/mlx4/cmd.c | 23 ++-
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c
b/drivers/net/ethernet
Some drivers declare num_active_cpus and num_present_cpus,
despite that kernel has macros with corresponding names in
linux/cpumask.h, and the drivers include cpumask.h
The following patches switch num_*_cpus() to real functions,
which causes build failures for the drivers.
Signed-off-by: Yury
ixes around bit counting that spotted my eyes.
Yury Norov (17):
all: don't use bitmap_weight() where possible
drivers: rename num_*_cpus variables
fix open-coded for_each_set_bit()
all: replace bitmap_weight with bitmap_empty where appropriate
all: replace cpumask_weight with cpu
1 - 100 of 151 matches
Mail list logo