[PATCH v6 11/12] mm/vmalloc: Hugepage vmalloc mappings

2020-08-21 Thread Nicholas Piggin
ces CPU cycles by 0.54%. This can result in more internal fragmentation and memory overhead for a given allocation, an option nohugevmalloc is added to disable at boot. Signed-off-by: Nicholas Piggin --- arch/Kconfig| 4 + include/linux/vmalloc.h | 1 + mm/page_alloc.c |

[PATCH v6 06/12] powerpc: inline huge vmap supported functions

2020-08-21 Thread Nicholas Piggin
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: linuxppc-...@lists.ozlabs.org Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/vmalloc.h | 19 --- arch/powerpc/mm/boo

Re: [PATCH v6 11/12] mm/vmalloc: Hugepage vmalloc mappings

2020-08-21 Thread Nicholas Piggin
Excerpts from Eric Dumazet's message of August 22, 2020 1:38 am: > > On 8/21/20 8:12 AM, Nicholas Piggin wrote: >> Support huge page vmalloc mappings. Config option HAVE_ARCH_HUGE_VMALLOC >> enables support on architectures that define HAVE_ARCH_HUGE_VMAP and >> sup

Re: [PATCH v6 01/12] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings

2020-08-21 Thread Nicholas Piggin
Excerpts from Andrew Morton's message of August 22, 2020 6:07 am: > On Sat, 22 Aug 2020 01:12:05 +1000 Nicholas Piggin wrote: > >> vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. >> Whether or not a vmap is huge depends on the architecture detai

Re: [PATCH v6 05/12] mm: HUGE_VMAP arch support cleanup

2020-08-21 Thread Nicholas Piggin
Excerpts from Andrew Morton's message of August 22, 2020 6:14 am: > On Sat, 22 Aug 2020 01:12:09 +1000 Nicholas Piggin wrote: > >> This changes the awkward approach where architectures provide init >> functions to determine which levels they can provide large mappings f

Re: [mm] 8e63b8bbd7: WARNING:at_mm/memory.c:#__apply_to_page_range

2020-08-21 Thread Nicholas Piggin
e pte is encountered") > url: > https://github.com/0day-ci/linux/commits/Nicholas-Piggin/huge-vmalloc-mappings/20200821-124543 > base: https://git.kernel.org/cgit/linux/kernel/git/powerpc/linux.git next > > in testcase: boot > > on test machine: qemu-system-x86_64 -enab

[RFC PATCH 0/7] mmu context cleanup, lazy tlb cleanup,

2020-07-09 Thread Nicholas Piggin
4. Add a non-refcounting lazy mmu mode, to help scalability when the same mm is used for a lot of lazy mmu switching. Comments, questions on anything would be much appreciated. Thanks, Nick Nicholas Piggin (7): asm-generic: add generic MMU versions of mmu context functions arch: use asm-gene

[RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-09 Thread Nicholas Piggin
right place. There is also a exit_lazy_tlb case that is not covered by this call, which could be a bugs (kthread use mm the membarrier process's mm then context switch back to the process without switching mm or lazy mm switch). This makes lazy tlb code a bit more modular. Signed-off-by

[RFC PATCH 2/7] arch: use asm-generic mmu context for no-op implementations

2020-07-09 Thread Nicholas Piggin
This patch bunches all architectures together. If the general idea is accepted I will split them individually. Some architectures can go further e.g., with consolidating switch_mm and activate_mm but I only did the more obvious ones. --- arch/alpha/include/asm/mmu_context.h | 12 ++--- arc

[RFC PATCH 1/7] asm-generic: add generic MMU versions of mmu context functions

2020-07-09 Thread Nicholas Piggin
Many of these are no-ops on many architectures, so extend mmu_context.h to cover MMU and NOMMU, and split the NOMMU bits out to nommu_context.h Cc: Arnd Bergmann Cc: Remis Lima Baima Signed-off-by: Nicholas Piggin --- arch/microblaze/include/asm/mmu_context.h | 2 +- arch/sh/include/asm

[RFC PATCH 6/7] lazy tlb: allow lazy tlb mm switching to be configurable

2020-07-09 Thread Nicholas Piggin
NOMMU systems could easily go without this and save a bit of code and the mm refcounting, because their mm switch is a no-op. I haven't flipped them over because haven't audited all arch code to convert over to using the _lazy_tlb refcounting. Signed-off-by: Nicholas Piggin --- ar

[RFC PATCH 5/7] lazy tlb: introduce lazy mm refcount helper functions

2020-07-09 Thread Nicholas Piggin
Add explicit _lazy_tlb annotated functions for lazy mm refcounting. This makes things a bit more explicit, and allows explicit refcounting to be removed if it is not used. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/smp.c| 2 +- arch/powerpc/mm/book3s64/radix_tlb.c | 4

[RFC PATCH 7/7] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-07-09 Thread Nicholas Piggin
f idle), upstream can achieve a rate of about 1 million context switches per second. After this patch it goes up to 118 million. Signed-off-by: Nicholas Piggin --- arch/Kconfig | 16 arch/powerpc/Kconfig | 1 + include/linux/sched/mm.h | 6 +++--- kernel/

[RFC PATCH 3/7] mm: introduce exit_lazy_tlb

2020-07-09 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- fs/exec.c | 5 +++-- include/asm-generic/mmu_context.h | 20 kernel/kthread.c | 1 + kernel/sched/core.c | 2 ++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/fs

Re: [PATCH v3 00/23] Use asm-generic for mmu_context no-op functions

2020-10-18 Thread Nicholas Piggin
Excerpts from Arnd Bergmann's message of October 10, 2020 6:25 pm: > On Sat, Oct 10, 2020 at 4:02 AM Stephen Rothwell > wrote: >> On Fri, 9 Oct 2020 16:01:22 +0200 Arnd Bergmann wrote: >> >> > Are there other changes that depend on this? If not, I would >> > just wait until -rc1 and then either

Re: [PATCH v2] page_alloc: Fix freeing non-compound pages

2020-10-18 Thread Nicholas Piggin
Excerpts from Andrew Morton's message of September 29, 2020 2:46 pm: > On Tue, 29 Sep 2020 02:17:19 +0100 Matthew Wilcox wrote: > >> On Mon, Sep 28, 2020 at 06:03:07PM -0700, Andrew Morton wrote: >> > On Sat, 26 Sep 2020 22:39:19 +0100 "Matthew Wilcox (Oracle)" >> > wrote: >> > >> > > Here is

[PATCH 3/3] powerpc: rewrite atomics to use ARCH_ATOMIC

2020-11-11 Thread Nicholas Piggin
All the cool kids are doing it. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/atomic.h | 681 ++--- arch/powerpc/include/asm/cmpxchg.h | 62 +-- 2 files changed, 248 insertions(+), 495 deletions(-) diff --git a/arch/powerpc/include/asm/atomic.h b/arch

[PATCH 2/3] powerpc/64s/iommu: don't use atomic_ function on atomic64_t type

2020-11-11 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/mm/book3s64/iommu_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/iommu_api.c b/arch/powerpc/mm/book3s64/iommu_api.c index 563faa10bb66..685d7bb3d26f 100644 --- a/arch/powerpc/mm/book3s64

[PATCH 1/3] asm-generic/atomic64: Add support for ARCH_ATOMIC

2020-11-11 Thread Nicholas Piggin
This passes atomic64 selftest on ppc32 on qemu (uniprocessor only) both before and after powerpc is converted to use ARCH_ATOMIC. Signed-off-by: Nicholas Piggin --- include/asm-generic/atomic64.h | 70 +++--- lib/atomic64.c | 36 - 2

[PATCH 0/3] powerpc: convert to use ARCH_ATOMIC

2020-11-11 Thread Nicholas Piggin
This conversion seems to require generic atomic64 changes, looks like nothing else uses ARCH_ATOMIC and GENERIC_ATOMIC64 yet. Thanks, Nick Nicholas Piggin (3): asm-generic/atomic64: Add support for ARCH_ATOMIC powerpc/64s/iommu: don't use atomic_ function on atomic64_t type po

Re: [PATCH 1/3] asm-generic/atomic64: Add support for ARCH_ATOMIC

2020-11-15 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of November 11, 2020 11:44 pm: > On Wed, Nov 11, 2020 at 02:39:01PM +0100, Christophe Leroy wrote: >> Hello, >> >> Le 11/11/2020 à 12:07, Nicholas Piggin a écrit : >> > This passes atomic64 selftest on ppc32 on qemu (unip

Re: [PATCH v2 1/3] powerpc/64s: Replace RFI by RFI_TO_KERNEL and remove RFI

2020-11-10 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of November 9, 2020 2:57 am: > In head_64.S, we have two places using RFI to return to > kernel. Use RFI_TO_KERNEL instead. > > They are the two only places using RFI on book3s/64, so > the RFI macro can go away. Looks good to me.

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-25 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 26, 2020 6:26 am: > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: >> diff --git a/arch/powerpc/include/asm/hw_irq.h >> b/arch/powerpc/include/asm/hw_irq.h >> index 3a0db7b0b46e..35060be09073 100644 >>

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-21 Thread Nicholas Piggin
Excerpts from Mathieu Desnoyers's message of July 21, 2020 2:46 am: > - On Jul 19, 2020, at 11:03 PM, Nicholas Piggin npig...@gmail.com wrote: > >> Excerpts from Mathieu Desnoyers's message of July 17, 2020 11:42 pm: >>> - On Jul 16, 2020, at 7:26 PM, Ni

Re: [PATCH v3 0/6] powerpc: queued spinlocks and rwlocks

2020-07-21 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 8, 2020 6:41 pm: > On Tue, Jul 07, 2020 at 03:57:06PM +1000, Nicholas Piggin wrote: >> Yes, powerpc could certainly get more performance out of the slow >> paths, and then there are a few parameters to tune. > Sorry for the

Re: [PATCH v3 0/6] powerpc: queued spinlocks and rwlocks

2020-07-21 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 9, 2020 6:31 pm: > On Wed, Jul 08, 2020 at 07:54:34PM -0400, Waiman Long wrote: >> On 7/8/20 4:41 AM, Peter Zijlstra wrote: >> > On Tue, Jul 07, 2020 at 03:57:06PM +1000, Nicholas Piggin wrote: >> > > Yes, powerpc c

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-21 Thread Nicholas Piggin
Excerpts from Mathieu Desnoyers's message of July 21, 2020 11:11 pm: > - On Jul 21, 2020, at 6:04 AM, Nicholas Piggin npig...@gmail.com wrote: > >> Excerpts from Mathieu Desnoyers's message of July 21, 2020 2:46 am: > [...] >> >> Yeah you're probabl

Re: [PATCH v3 2/3] powerpc/powernv/idle: Rename pnv_first_spr_loss_level variable

2020-07-21 Thread Nicholas Piggin
Excerpts from Pratik Sampat's message of July 21, 2020 8:29 pm: > > > On 20/07/20 5:27 am, Nicholas Piggin wrote: >> Excerpts from Pratik Rajesh Sampat's message of July 18, 2020 4:53 am: >>> Replace the variable name from using "pnv_first_spr_loss_level&

Re: [RFC PATCH 7/7] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-07-15 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of July 14, 2020 10:46 pm: > > >> On Jul 13, 2020, at 11:31 PM, Nicholas Piggin wrote: >> >> Excerpts from Nicholas Piggin's message of July 14, 2020 3:04 pm: >>> Excerpts from Andy Lutomirski's message

Re: [RFC PATCH 7/7] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-07-15 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of July 14, 2020 10:46 pm: > > >> On Jul 13, 2020, at 11:31 PM, Nicholas Piggin wrote: >> >> Excerpts from Nicholas Piggin's message of July 14, 2020 3:04 pm: >>> Excerpts from Andy Lutomirski's message

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-15 Thread Nicholas Piggin
Excerpts from Mathieu Desnoyers's message of July 14, 2020 12:13 am: > - On Jul 13, 2020, at 9:47 AM, Nicholas Piggin npig...@gmail.com wrote: > >> Excerpts from Nicholas Piggin's message of July 13, 2020 2:45 pm: >>> Excerpts from Andy Lutomirski's message

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-15 Thread Nicholas Piggin
Excerpts from Nicholas Piggin's message of July 16, 2020 2:15 pm: > Excerpts from Mathieu Desnoyers's message of July 14, 2020 12:13 am: >> - On Jul 13, 2020, at 9:47 AM, Nicholas Piggin npig...@gmail.com wrote: >> >>> Excerpts from Nicholas Piggin&

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-15 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of July 16, 2020 3:18 pm: > > >> On Jul 15, 2020, at 9:15 PM, Nicholas Piggin wrote: >> >> Excerpts from Mathieu Desnoyers's message of July 14, 2020 12:13 am: >>> - On Jul 13, 2020, at 9:47

Re: KCSAN: data-race in generic_file_buffered_read / generic_file_buffered_read

2020-07-15 Thread Nicholas Piggin
Excerpts from Eric Biggers's message of July 16, 2020 1:03 pm: > On Thu, Jul 16, 2020 at 09:42:03AM +1000, Dave Chinner wrote: >> On Wed, Jul 15, 2020 at 09:32:56AM -0700, Eric Biggers wrote: >> > [+Cc linux-fsdevel] >> > >> > On Wed, Jul 15, 2020 at 05:29:12PM +0200, 'Marco Elver' via syzkaller-b

Re: KCSAN: data-race in generic_file_buffered_read / generic_file_buffered_read

2020-07-16 Thread Nicholas Piggin
Excerpts from Eric Biggers's message of July 16, 2020 4:54 pm: > On Thu, Jul 16, 2020 at 04:24:01PM +1000, Nicholas Piggin wrote: >> Excerpts from Eric Biggers's message of July 16, 2020 1:03 pm: >> > On Thu, Jul 16, 2020 at 09:42:03AM +1000, Dave Chinner wrote: >>

Re: [PATCH v3 2/3] powerpc/powernv/idle: Rename pnv_first_spr_loss_level variable

2020-07-19 Thread Nicholas Piggin
Excerpts from Pratik Rajesh Sampat's message of July 18, 2020 4:53 am: > Replace the variable name from using "pnv_first_spr_loss_level" to > "pnv_first_fullstate_loss_level". > > As pnv_first_spr_loss_level is supposed to be the earliest state that > has OPAL_PM_LOSE_FULL_CONTEXT set, however as

Re: [PATCH v3 1/3] powerpc/powernv/idle: Replace CPU features checks with PVR checks

2020-07-19 Thread Nicholas Piggin
Excerpts from Pratik Rajesh Sampat's message of July 18, 2020 4:53 am: > As the idle framework's architecture is incomplete, hence instead of > checking for just the processor type advertised in the device tree CPU > features; check for the Processor Version Register (PVR) so that finer > granulari

Re: [PATCH v3 3/3] powerpc/powernv/idle: Exclude mfspr on HID1,4,5 on P9 and above

2020-07-19 Thread Nicholas Piggin
r the > check for machines lower than Power9 > > Signed-off-by: Pratik Rajesh Sampat > Reviewed-by: Gautham R. Shenoy Reviewed-by: Nicholas Piggin > --- > arch/powerpc/platforms/powernv/idle.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff -

io_uring kthread_use_mm / mmget_not_zero possible abuse

2020-07-19 Thread Nicholas Piggin
When I last looked at this (predating io_uring), as far as I remember it was not permitted to actually switch to (use_mm) an mm user context that was pinned with mmget_not_zero. Those pins were only allowed to look at page tables, vmas, etc., but not actually run the CPU in that mm context. spa

Re: [PATCH v2 4/4] mm/vmalloc: Hugepage vmalloc mappings

2020-07-19 Thread Nicholas Piggin
Excerpts from Zefan Li's message of July 20, 2020 12:02 pm: >> +static int vmap_pages_range_noflush(unsigned long start, unsigned long end, >> +pgprot_t prot, struct page **pages, >> +unsigned int page_shift) >> +{ >> +if (page_shi

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-19 Thread Nicholas Piggin
Excerpts from Mathieu Desnoyers's message of July 17, 2020 11:42 pm: > - On Jul 16, 2020, at 7:26 PM, Nicholas Piggin npig...@gmail.com wrote: > [...] >> >> membarrier does replace barrier instructions on remote CPUs, which do >> order accesses performed by t

[PATCH 11/24] mips: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Thomas Bogendoerfer Cc: linux-m...@vger.kernel.org Signed-off-by: Nicholas Piggin --- arch/mips/include/asm/mmu_context.h | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h index

[PATCH 08/24] ia64: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Tony Luck Cc: Fenghua Yu Cc: linux-i...@vger.kernel.org Signed-off-by: Nicholas Piggin --- arch/ia64/include/asm/mmu_context.h | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/ia64/include/asm/mmu_context.h b/arch/ia64/include/asm/mmu_context.h

[PATCH 09/24] m68k: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Geert Uytterhoeven Cc: linux-m...@lists.linux-m68k.org Signed-off-by: Nicholas Piggin --- arch/m68k/include/asm/mmu_context.h | 47 + 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/arch/m68k/include/asm/mmu_context.h b/arch/m68k/include/asm

[PATCH 03/24] arc: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Vineet Gupta Cc: linux-snps-...@lists.infradead.org Signed-off-by: Nicholas Piggin --- arch/arc/include/asm/mmu_context.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arc/include/asm/mmu_context.h b/arch/arc/include/asm/mmu_context.h index

[PATCH 06/24] csky: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Guo Ren Cc: linux-c...@vger.kernel.org Signed-off-by: Nicholas Piggin --- arch/csky/include/asm/mmu_context.h | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/csky/include/asm/mmu_context.h b/arch/csky/include/asm/mmu_context.h index abdf1f1cb6ec

[PATCH 14/24] openrisc: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: openr...@lists.librecores.org Signed-off-by: Nicholas Piggin --- arch/openrisc/include/asm/mmu_context.h | 8 +++- arch/openrisc/mm/tlb.c | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a

[PATCH 02/24] alpha: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: linux-al...@vger.kernel.org Signed-off-by: Nicholas Piggin --- arch/alpha/include/asm/mmu_context.h | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/alpha/include/asm/mmu_context.h b/arch/alpha

[PATCH 05/24] arm64: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/mmu_context.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm

[PATCH 07/24] hexagon: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Brian Cain Cc: linux-hexa...@vger.kernel.org Signed-off-by: Nicholas Piggin --- arch/hexagon/include/asm/mmu_context.h | 33 -- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/arch/hexagon/include/asm/mmu_context.h b/arch/hexagon/include/asm

[PATCH 00/24] Use asm-generic for mmu_context no-op functions

2020-07-27 Thread Nicholas Piggin
of them in the next window? Thanks, Nick Nicholas Piggin (24): asm-generic: add generic versions of mmu context functions alpha: use asm-generic/mmu_context.h for no-op implementations arc: use asm-generic/mmu_context.h for no-op implementations arm: use asm-generic/mmu_context.h

[PATCH 01/24] asm-generic: add generic versions of mmu context functions

2020-07-27 Thread Nicholas Piggin
Many of these are no-ops on many architectures, so extend mmu_context.h to cover MMU and NOMMU, and split the NOMMU bits out to nommu_context.h Cc: Arnd Bergmann Cc: linux-a...@vger.kernel.org Signed-off-by: Nicholas Piggin --- arch/microblaze/include/asm/mmu_context.h | 2 +- arch/sh/include

[PATCH 04/24] arm: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Nicholas Piggin --- arch/arm/include/asm/mmu_context.h | 26 +++--- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm

[PATCH 23/24] x86: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Nicholas Piggin --- arch/x86/include/asm/mmu_context.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/i

[PATCH 10/24] microblaze: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Michal Simek Signed-off-by: Nicholas Piggin --- arch/microblaze/include/asm/mmu_context_mm.h | 8 arch/microblaze/include/asm/processor.h | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/microblaze/include/asm/mmu_context_mm.h b/arch/microblaze

[PATCH 12/24] nds32: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen Signed-off-by: Nicholas Piggin --- arch/nds32/include/asm/mmu_context.h | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/nds32/include/asm/mmu_context.h b/arch/nds32/include/asm/mmu_context.h index b8fd3d189fdc

[PATCH 13/24] nios2: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Ley Foon Tan Signed-off-by: Nicholas Piggin --- arch/nios2/include/asm/mmu_context.h | 21 - arch/nios2/mm/mmu_context.c | 1 + 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/arch/nios2/include/asm/mmu_context.h b/arch/nios2/include/asm

[PATCH 21/24] um: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Cc: linux...@lists.infradead.org Signed-off-by: Nicholas Piggin --- arch/um/include/asm/mmu_context.h | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/um/include/asm/mmu_context.h b/arch/um/include/asm

[PATCH 22/24] unicore32: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Guan Xuetao Signed-off-by: Nicholas Piggin --- arch/unicore32/include/asm/mmu_context.h | 24 +++- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/arch/unicore32/include/asm/mmu_context.h b/arch/unicore32/include/asm/mmu_context.h index 388c0c811c68

[PATCH 17/24] riscv: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: linux-ri...@lists.infradead.org Signed-off-by: Nicholas Piggin --- arch/riscv/include/asm/mmu_context.h | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/arch/riscv/include/asm/mmu_context.h b

[PATCH 16/24] powerpc: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-...@lists.ozlabs.org Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/mmu_context.h | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/include/asm

[PATCH 20/24] sparc: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: "David S. Miller" Cc: sparcli...@vger.kernel.org Signed-off-by: Nicholas Piggin --- arch/sparc/include/asm/mmu_context_32.h | 10 -- arch/sparc/include/asm/mmu_context_64.h | 10 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/sparc/i

[PATCH 15/24] parisc: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-par...@vger.kernel.org Signed-off-by: Nicholas Piggin --- arch/parisc/include/asm/mmu_context.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/parisc/include/asm/mmu_context.h b/arch/pari

[PATCH 19/24] sh: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Yoshinori Sato Cc: Rich Felker Cc: linux...@vger.kernel.org Signed-off-by: Nicholas Piggin --- arch/sh/include/asm/mmu_context.h| 5 ++--- arch/sh/include/asm/mmu_context_32.h | 9 - 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/arch/sh/include/asm

[PATCH 24/24] xtensa: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Chris Zankel Cc: Max Filippov Cc: linux-xte...@linux-xtensa.org Signed-off-by: Nicholas Piggin --- arch/xtensa/include/asm/mmu_context.h | 11 +++ arch/xtensa/include/asm/nommu_context.h | 26 + 2 files changed, 4 insertions(+), 33 deletions(-) diff --git

[PATCH 18/24] s390: use asm-generic/mmu_context.h for no-op implementations

2020-07-27 Thread Nicholas Piggin
Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: linux-s...@vger.kernel.org Signed-off-by: Nicholas Piggin --- arch/s390/include/asm/mmu_context.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390

Re: [PATCH 01/24] asm-generic: add generic versions of mmu context functions

2020-07-28 Thread Nicholas Piggin
Excerpts from Vineet Gupta's message of July 28, 2020 2:01 pm: > On 7/27/20 8:33 PM, Nicholas Piggin wrote: >> Many of these are no-ops on many architectures, so extend mmu_context.h >> to cover MMU and NOMMU, and split the NOMMU bits out to nommu_context.h >> > >

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-28 Thread Nicholas Piggin
Excerpts from pet...@infradead.org's message of July 26, 2020 10:11 pm: > On Sun, Jul 26, 2020 at 02:14:34PM +1000, Nicholas Piggin wrote: >> Excerpts from Peter Zijlstra's message of July 26, 2020 6:26 am: > >> > Which is 'funny' when it interlea

Re: [PATCH v2 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-05 Thread Nicholas Piggin
Excerpts from Waiman Long's message of July 6, 2020 5:00 am: > On 7/3/20 3:35 AM, Nicholas Piggin wrote: >> Signed-off-by: Nicholas Piggin >> --- >> arch/powerpc/include/asm/paravirt.h | 28 ++ >> arch/powerpc/inclu

Re: [RFC PATCH 4/5] powerpc/mm: Remove custom stack expansion checking

2020-07-05 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of July 6, 2020 3:49 am: > > > Le 03/07/2020 à 16:13, Michael Ellerman a écrit : >> We have powerpc specific logic in our page fault handling to decide if >> an access to an unmapped address below the stack pointer should expand >> the stack VMA. >> >> Th

[PATCH v3 1/6] powerpc/powernv: must include hvcall.h to get PAPR defines

2020-07-05 Thread Nicholas Piggin
An include goes away in future patches which breaks compilation without this. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/powernv/pci-ioda-tce.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv/pci-ioda-tce.c b/arch/powerpc/platforms/powernv/pci

[PATCH v3 0/6] powerpc: queued spinlocks and rwlocks

2020-07-05 Thread Nicholas Piggin
v3 is updated to use __pv_queued_spin_unlock, noticed by Waiman (thank you). Thanks, Nick Nicholas Piggin (6): powerpc/powernv: must include hvcall.h to get PAPR defines powerpc/pseries: move some PAPR paravirt functions to their own file powerpc: move spinlock implementation to

[PATCH v3 6/6] powerpc/qspinlock: optimised atomic_try_cmpxchg_lock that adds the lock hint

2020-07-05 Thread Nicholas Piggin
This brings the behaviour of the uncontended fast path back to roughly equivalent to simple spinlocks -- a single atomic op with lock hint. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/atomic.h| 28 arch/powerpc/include/asm/qspinlock.h | 2 +- 2

[PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-05 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/paravirt.h | 28 arch/powerpc/include/asm/qspinlock.h | 66 +++ arch/powerpc/include/asm/qspinlock_paravirt.h | 7 ++ arch/powerpc/platforms/pseries/Kconfig| 5 ++ arch/powerpc

[PATCH v3 3/6] powerpc: move spinlock implementation to simple_spinlock

2020-07-05 Thread Nicholas Piggin
To prepare for queued spinlocks. This is a simple rename except to update preprocessor guard name and a file reference. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/simple_spinlock.h| 292 ++ .../include/asm/simple_spinlock_types.h | 21 ++ arch/powerpc

[PATCH v3 4/6] powerpc/64s: implement queued spinlocks and rwlocks

2020-07-05 Thread Nicholas Piggin
. Signed-off-by: Nicholas Piggin --- arch/powerpc/Kconfig | 13 arch/powerpc/include/asm/Kbuild | 2 ++ arch/powerpc/include/asm/qspinlock.h | 25 +++ arch/powerpc/include/asm/spinlock.h | 5 + arch/powerpc/include

[PATCH v3 2/6] powerpc/pseries: move some PAPR paravirt functions to their own file

2020-07-05 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/paravirt.h | 61 + arch/powerpc/include/asm/spinlock.h | 24 +--- arch/powerpc/lib/locks.c| 12 +++--- 3 files changed, 68 insertions(+), 29 deletions(-) create mode 100644 arch/powerpc

Re: [PATCH v3 0/6] powerpc: queued spinlocks and rwlocks

2020-07-06 Thread Nicholas Piggin
Excerpts from Waiman Long's message of July 7, 2020 4:39 am: > On 7/6/20 12:35 AM, Nicholas Piggin wrote: >> v3 is updated to use __pv_queued_spin_unlock, noticed by Waiman (thank you). >> >> Thanks, >> Nick >> >> Nicholas Piggin (6): >>

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote: > >> diff --git a/arch/powerpc/include/asm/hw_irq.h >> b/arch/powerpc/include/asm/hw_irq.h >> index 3a0db7b0b46e..35060be09073 100644

Re: [PATCH v3 0/6] powerpc: queued spinlocks and rwlocks

2020-07-23 Thread Nicholas Piggin
Excerpts from Waiman Long's message of July 22, 2020 12:36 am: > On 7/21/20 7:08 AM, Nicholas Piggin wrote: >> diff --git a/arch/powerpc/include/asm/qspinlock.h >> b/arch/powerpc/include/asm/qspinlock.h >> index b752d34517b3..26d8766a1106 100644 >> --- a/arch

Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-23 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of July 9, 2020 8:53 pm: > Nicholas Piggin writes: > >> Signed-off-by: Nicholas Piggin >> --- >> arch/powerpc/include/asm/paravirt.h | 28 >> arch/powerpc/include/asm/qspinlock.h | 66 +

Re: [PATCH v3 0/6] powerpc: queued spinlocks and rwlocks

2020-07-23 Thread Nicholas Piggin
Excerpts from Waiman Long's message of July 24, 2020 12:29 am: > On 7/23/20 9:30 AM, Nicholas Piggin wrote: >>> I would prefer to extract out the pending bit handling code out into a >>> separate helper function which can be overridden by the arch code >>> inst

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 24, 2020 12:59 am: > On Thu, Jul 23, 2020 at 11:11:03PM +1000, Nicholas Piggin wrote: >> Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: >> > On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wro

Re: [PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Nicholas Piggin
Excerpts from Alexey Kardashevskiy's message of July 24, 2020 2:16 pm: > > > On 23/07/2020 23:11, Nicholas Piggin wrote: >> Excerpts from Peter Zijlstra's message of July 23, 2020 9:40 pm: >>> On Thu, Jul 23, 2020 at 08:56:14PM +1000, Nicholas Piggin wrote:

[PATCH v4 4/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-24 Thread Nicholas Piggin
investigated and improved in future. Performance results can be found in the commit which added queued spinlocks. Acked-by: Peter Zijlstra (Intel) Acked-by: Waiman Long Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/paravirt.h | 28 arch/powerpc/include/asm

[PATCH v4 0/6] powerpc: queued spinlocks and rwlocks

2020-07-24 Thread Nicholas Piggin
cool technology and great results especially on the big systems but even on smaller ones there are nice gains. Thanks Waiman and everyone who developed it. Thanks, Nick Nicholas Piggin (6): powerpc/pseries: move some PAPR paravirt functions to their own file powerpc: move spinlock implemen

[PATCH v4 1/6] powerpc/pseries: move some PAPR paravirt functions to their own file

2020-07-24 Thread Nicholas Piggin
These functions will be used by queued spinlock implementation, and may be useful elsewhere too, so move them out of spinlock.h. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/paravirt.h | 59 + arch/powerpc/include/asm/spinlock.h | 24 +--- arch

[PATCH v4 3/6] powerpc/64s: implement queued spinlocks and rwlocks

2020-07-24 Thread Nicholas Piggin
regressions haven't been analysed very well yet, there are a lot of things that can be tuned, particularly the paravirtualised locking, but the numbers already look like a good net win even on relatively small systems. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Nicholas Piggin --- arch/po

[PATCH v4 2/6] powerpc: move spinlock implementation to simple_spinlock

2020-07-24 Thread Nicholas Piggin
To prepare for queued spinlocks. This is a simple rename except to update preprocessor guard name and a file reference. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/simple_spinlock.h| 288 ++ .../include/asm/simple_spinlock_types.h | 21 ++ arch/powerpc

[PATCH v4 6/6] powerpc: implement smp_cond_load_relaxed

2020-07-24 Thread Nicholas Piggin
This implements smp_cond_load_relaed with the slowpath busy loop using the preferred SMT priority pattern. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/barrier.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/powerpc/include/asm/barrier.h b/arch/powerpc

[PATCH v4 5/6] powerpc/qspinlock: optimised atomic_try_cmpxchg_lock that adds the lock hint

2020-07-24 Thread Nicholas Piggin
This brings the behaviour of the uncontended fast path back to roughly equivalent to simple spinlocks -- a single atomic op with lock hint. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/atomic.h| 28 arch/powerpc/include/asm/qspinlock.h | 2 +- 2

Re: [PATCH v3] mm: Fix kthread_use_mm() vs TLB invalidate

2020-07-23 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 22, 2020 6:35 pm: > On Tue, Jul 21, 2020 at 02:06:23PM -0700, Andrew Morton wrote: >> On Tue, 21 Jul 2020 17:41:06 +0200 Peter Zijlstra >> wrote: >> >> > >> > For SMP systems using IPI based TLB invalidation, looking at >> > current->active_mm is e

[PATCH 1/2] lockdep: improve current->(hard|soft)irqs_enabled synchronisation with actual irq state

2020-07-23 Thread Nicholas Piggin
Kardashevskiy Signed-off-by: Nicholas Piggin --- I haven't tested on other architectures but I imagine NMIs in general might cause a similar problem. Other architectures might have to be updated for patch 2, but there's a lot of asm around interrupt/return, so I didn't have a very

[PATCH 2/2] lockdep: warn on redundant or incorrect irq state changes

2020-07-23 Thread Nicholas Piggin
to NMIs etc. Signed-off-by: Nicholas Piggin --- kernel/locking/lockdep.c | 80 +- kernel/locking/lockdep_internals.h | 4 -- kernel/locking/lockdep_proc.c | 10 +--- 3 files changed, 35 insertions(+), 59 deletions(-) diff --git a/kernel/locking

Re: [PATCH 2/2] locking/pvqspinlock: Optionally store lock holder cpu into lock

2020-07-12 Thread Nicholas Piggin
Excerpts from Waiman Long's message of July 13, 2020 9:05 am: > On 7/12/20 1:34 PM, Peter Zijlstra wrote: >> On Sat, Jul 11, 2020 at 02:21:28PM -0400, Waiman Long wrote: >>> The previous patch enables native qspinlock to store lock holder cpu >>> number into the lock word when the lock is acquired

Re: [RFC PATCH 4/7] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-07-12 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of July 11, 2020 3:04 am: > On Thu, Jul 9, 2020 at 6:57 PM Nicholas Piggin wrote: >> >> And get rid of the generic sync_core_before_usermode facility. >> >> This helper is the wrong way around I think. The idea that membarri

Re: [RFC PATCH 7/7] lazy tlb: shoot lazies, a non-refcounting lazy tlb option

2020-07-12 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of July 10, 2020 7:35 pm: > On Fri, Jul 10, 2020 at 11:56:46AM +1000, Nicholas Piggin wrote: >> On big systems, the mm refcount can become highly contented when doing >> a lot of context switching with threaded applications (particularly

Re: [PATCH v2 0/3] Power10 basic energy management

2020-07-12 Thread Nicholas Piggin
Excerpts from Pratik Rajesh Sampat's message of July 10, 2020 3:22 pm: > Changelog v1 --> v2: > 1. Save-restore DAWR and DAWRX unconditionally as they are lost in > shallow idle states too > 2. Rename pnv_first_spr_loss_level to pnv_first_fullstate_loss_level to > correct naming terminology > > Pr

Re: [PATCH v2 2/3] powerpc/powernv/idle: save-restore DAWR0, DAWRX0 for P10

2020-07-12 Thread Nicholas Piggin
Excerpts from Pratik Rajesh Sampat's message of July 10, 2020 3:22 pm: > Additional registers DAWR0, DAWRX0 may be lost on Power 10 for > stop levels < 4. > Therefore save the values of these SPRs before entering a "stop" > state and restore their values on wakeup. Hmm, where do you get this from

Re: [PATCH v2 1/3] powerpc/powernv/idle: Exclude mfspr on HID1, 4, 5 on P9 and above

2020-07-12 Thread Nicholas Piggin
Excerpts from Pratik Rajesh Sampat's message of July 10, 2020 3:22 pm: > POWER9 onwards the support for the registers HID1, HID4, HID5 has been > receded. > Although mfspr on the above registers worked in Power9, In Power10 > simulator is unrecognized. Moving their assignment under the > check for

<    3   4   5   6   7   8   9   10   11   >