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

2021-11-27 Thread Yury Norov
(restore CC list) On Sun, Nov 28, 2021 at 05:56:51AM +0100, Michał Mirosław wrote: > On Sat, Nov 27, 2021 at 07:57:02PM -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

Re: [PATCH 2/9] lib/bitmap: implement bitmap_{empty,full} with bitmap_weight_eq()

2021-11-27 Thread Yury Norov
On Sun, Nov 28, 2021 at 05:37:19AM +0100, Michał Mirosław wrote: > On Sat, Nov 27, 2021 at 07:56:57PM -0800, Yury Norov wrote: > > Now as we have bitmap_weight_eq(), switch bitmap_full() and > > bitmap_empty() to using it. > [...] > > -static inline bool bitmap_empty(const unsigned long *src,

[PATCH 9/9] MAINTAINERS: add cpumask and nodemask files to BITMAP_API

2021-11-27 Thread 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

[PATCH 8/9] lib/nodemask: add num_node_state_eq()

2021-11-27 Thread Yury Norov
Add num_node_state_eq() and replace num_node_state() with it in page_alloc_init(). Signed-off-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

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

2021-11-27 Thread Yury Norov
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. Signed-off-by: Yury Norov --- arch/arc/kernel/smp.c | 2 +-

[PATCH 6/9] lib/nodemask: add nodemask_weight_{eq,gt,le}

2021-11-27 Thread Yury Norov
Add nodemask_weight_{eq,gt,le} and replace nodemask_weight() where appropriate. This allows nodemask_weight_*() to return earlier depending on the condition. Signed-off-by: Yury Norov --- arch/x86/mm/amdtopology.c| 2 +- arch/x86/mm/numa_emulation.c | 4 ++-- drivers/acpi/numa/srat.c

[PATCH 5/9] lib/cpumask: add cpumask_weight_{eq,gt,le}

2021-11-27 Thread Yury Norov
Add cpumask_weight_{eq,gt,le} and replace cpumask_weight() with one of cpumask_weight_{empty,eq,gt,le} where appropriate. This allows cpumask_weight_*() to return earlier depending on the condition. Signed-off-by: Yury Norov --- arch/alpha/kernel/process.c | 2 +-

[PATCH 4/9] tools: sync bitmap_weight() usage with the kernel

2021-11-27 Thread Yury Norov
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 adds bitmap_weight_{eq,gt,le}, reimplements bitmap_{empty,full} and

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

2021-11-27 Thread Yury Norov
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 replaces bitmap_weight() with one of bitmap_{empty,full,eq,gt,le), as

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

2021-11-27 Thread Yury Norov
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_cpus() will traverse every word of underlying cpumask unconditionally. We

[PATCH 1/9] lib/bitmap: add bitmap_weight_{eq,gt,le}

2021-11-27 Thread Yury Norov
Many kernel users call bitmap_weight() to compare the result against some number or expression: if (bitmap_weight(...) > 1) do_something(); It works OK, but may be significantly improved for large bitmaps: if first few words count set bits to a number greater than given,

[PATCH 2/9] lib/bitmap: implement bitmap_{empty, full} with bitmap_weight_eq()

2021-11-27 Thread Yury Norov
Now as we have bitmap_weight_eq(), switch bitmap_full() and bitmap_empty() to using it. Signed-off-by: Yury Norov --- include/linux/bitmap.h | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index

Re: [patch 00/22] genirq/msi, PCI/MSI: Spring cleaning - Part 1

2021-11-27 Thread Jason Gunthorpe
On Sat, Nov 27, 2021 at 02:18:34AM +0100, Thomas Gleixner wrote: > The [PCI] MSI code has gained quite some warts over time. A recent > discussion unearthed a shortcoming: the lack of support for expanding > PCI/MSI-X vectors after initialization of MSI-X. > > PCI/MSI-X has no requirement to

[powerpc:next-test] BUILD SUCCESS 965bc079ba0aa7a750c66cd8b34d8bccc81300d3

2021-11-27 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test branch HEAD: 965bc079ba0aa7a750c66cd8b34d8bccc81300d3 powerpc/ftrace: Activate HAVE_DYNAMIC_FTRACE_WITH_REGS on PPC32 elapsed time: 799m configs tested: 39 configs skipped: 18 The following configs have

[PATCH v3 3/4] powerpc/inst: Define ppc_inst_t as u32 on PPC32

2021-11-27 Thread Christophe Leroy
Unlike PPC64 ABI, PPC32 uses the stack to pass a parameter defined as a struct, even when the struct has a single simple element. To avoid that, define ppc_inst_t as u32 on PPC32. Keep it as 'struct ppc_inst' when __CHECKER__ is defined so that sparse can perform type checking. Also revert

[PATCH v3 2/4] powerpc/inst: Define ppc_inst_t

2021-11-27 Thread Christophe Leroy
In order to stop using 'struct ppc_inst' on PPC32, define a ppc_inst_t typedef. Signed-off-by: Christophe Leroy --- v3: Rebased and resolved conflicts v2: Anonymise the structure so that only the typedef can be used Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h

[PATCH v3 4/4] powerpc/inst: Optimise copy_inst_from_kernel_nofault()

2021-11-27 Thread Christophe Leroy
copy_inst_from_kernel_nofault() uses copy_from_kernel_nofault() to copy one or two 32bits words. This means calling an out-of-line function which itself calls back copy_from_kernel_nofault_allowed() then performs a generic copy with loops. Rewrite copy_inst_from_kernel_nofault() to do everything

[PATCH v3 1/4] powerpc/inst: Refactor ___get_user_instr()

2021-11-27 Thread Christophe Leroy
PPC64 version of ___get_user_instr() can be used for PPC32 as well, by simply disabling the suffix part with IS_ENABLED(CONFIG_PPC64). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/inst.h | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git

Re: [PATCH] powerpc/mm: fix early initialization failure for MMUs with no hash table

2021-11-27 Thread Christophe Leroy
Le 27/11/2021 à 03:04, Vladimir Oltean a écrit : The blamed patch attempted to do a trivial conversion of map_mem_in_cams() by adding an extra "bool init" argument, but by mistake, changed the way in which two call sites pass the other boolean argument, "bool dry_run". As a result,

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.16-3 tag

2021-11-27 Thread pr-tracker-bot
The pull request you sent on Sat, 27 Nov 2021 20:51:41 +1100: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-5.16-3 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/7b65b798a604aff77d5e744833b5d452d2081467 Thank you! --

Re: [PATCH] powerpc/mm: fix early initialization failure for MMUs with no hash table

2021-11-27 Thread Vladimir Oltean
On Sat, Nov 27, 2021 at 04:04:48AM +0200, Vladimir Oltean wrote: > The blamed patch attempted to do a trivial conversion of > map_mem_in_cams() by adding an extra "bool init" argument, but by > mistake, changed the way in which two call sites pass the other boolean > argument, "bool dry_run". > >

[PATCH] net: spider_net: Use non-atomic bitmap API when applicable

2021-11-27 Thread Christophe JAILLET
No concurrent access is possible when a bitmap is local to a function. So prefer the non-atomic functions to save a few cycles. - replace a 'for' loop by an equivalent non-atomic 'bitmap_fill()' call - use '__set_bit()' While at it, clear the 'bitmask' bitmap only when needed.

[GIT PULL] Please pull powerpc/linux.git powerpc-5.16-3 tag

2021-11-27 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Linus, Please pull some more powerpc fixes for 5.16: The following changes since commit 136057256686de39cc3a07c2e39ef6bc43003ff6: Linux 5.16-rc2 (2021-11-21 13:47:39 -0800) are available in the git repository at: