[PATCH v3 5/8] mm: HUGE_VMAP arch support cleanup

2020-08-09 Thread Nicholas Piggin
also adds a prot argument to the arch query. This is unused currently but could help with some architectures (e.g., some powerpc processors can't map uncacheable memory with large pages). Signed-off-by: Nicholas Piggin --- arch/arm64/mm/mmu.c | 10 +-- arch/powerpc/mm/boo

[PATCH v3 7/8] mm/vmalloc: add vmap_range_noflush variant

2020-08-09 Thread Nicholas Piggin
As a side-effect, the order of flush_cache_vmap() and arch_sync_kernel_mappings() calls are switched, but that now matches the other callers in this file. Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mm

[PATCH v3 6/8] mm: Move vmap_range from lib/ioremap.c to mm/vmalloc.c

2020-08-09 Thread Nicholas Piggin
This is a generic kernel virtual memory mapper, not specific to ioremap. Signed-off-by: Nicholas Piggin --- include/linux/vmalloc.h | 2 + mm/ioremap.c| 192 mm/vmalloc.c| 191 +++ 3 files

[PATCH v3 1/8] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings

2020-08-09 Thread Nicholas Piggin
pings") Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 40 ++-- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index b482d240f9a2..49f225b0f855 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -38,6 +38,7 @@

[RFC PATCH 2/2] powerpc/64s/radix: Fix mm_cpumask trimming race vs kthread_use_mm

2020-08-17 Thread Nicholas Piggin
f77c7798a7 ("powerpc/64s/radix: flush remote CPUs out of single-threaded mm_cpumask") not-yet-Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/tlb.h | 13 - arch/powerpc/mm/book3s64/radix_tlb.c | 23 --- 2 files changed, 16 insertion

[RFC PATCH 1/2] sparc64: remove mm_cpumask clearing to fix kthread_use_mm race

2020-08-17 Thread Nicholas Piggin
mm_cpumask clearing code. The optimisation could be effectively restored by sending IPIs to mm_cpumask members and having them remove themselves from mm_cpumask. This is more tricky so I leave it as an exercise for someone with a sparc64 SMP. powerpc has a (currently similarly broken) example. not-

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

2020-08-18 Thread Nicholas Piggin
Excerpts from pet...@infradead.org's message of August 12, 2020 8:35 pm: > On Wed, Aug 12, 2020 at 06:18:28PM +1000, Nicholas Piggin wrote: >> Excerpts from pet...@infradead.org's message of August 7, 2020 9:11 pm: >> > >> > What's wrong with somethi

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

2020-08-18 Thread Nicholas Piggin
Excerpts from pet...@infradead.org's message of August 19, 2020 1:41 am: > On Tue, Aug 18, 2020 at 05:22:33PM +1000, Nicholas Piggin wrote: >> Excerpts from pet...@infradead.org's message of August 12, 2020 8:35 pm: >> > On Wed, Aug 12, 2020 at 06:18:28PM

[PATCH RFC] mm: increase page waitqueue hash size

2020-08-19 Thread Nicholas Piggin
, which should help reduce remote accesses on well localised workloads, but that adds some complexity with hotplug, so until we get a less artificial workload to test with, let's keep it simple. Signed-off-by: Nicholas Piggin --- mm/filemap.c | 24 +--- 1 file change

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

2020-12-21 Thread Nicholas Piggin
Excerpts from Boqun Feng's message of November 14, 2020 1:30 am: > Hi Nicholas, > > On Wed, Nov 11, 2020 at 09:07:23PM +1000, Nicholas Piggin wrote: >> All the cool kids are doing it. >> >> Signed-off-by: Nicholas Piggin >> --- >&g

Re: [RFC please help] membarrier: Rewrite sync_core_before_usermode()

2020-12-28 Thread Nicholas Piggin
his more carefully in the first place. > > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: linuxppc-...@lists.ozlabs.org > Cc: Nicholas Piggin > Cc: Catalin Marinas > Cc: Will Deacon > Cc: linux-arm-ker...@lists.infradead.org > Cc: M

Re: [RFC please help] membarrier: Rewrite sync_core_before_usermode()

2020-12-28 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of December 29, 2020 7:06 am: > On Mon, Dec 28, 2020 at 12:32 PM Mathieu Desnoyers > wrote: >> >> - On Dec 28, 2020, at 2:44 PM, Andy Lutomirski l...@kernel.org wrote: >> >> > On Mon, Dec 28, 2020 at 11:09 AM Russell King - ARM Linux admin >> > wrote: >

Re: [RFC please help] membarrier: Rewrite sync_core_before_usermode()

2020-12-28 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of December 29, 2020 10:56 am: > On Mon, Dec 28, 2020 at 4:36 PM Nicholas Piggin wrote: >> >> Excerpts from Andy Lutomirski's message of December 29, 2020 7:06 am: >> > On Mon, Dec 28, 2020 at 12:32 PM Mathieu Desnoyers >

Re: [RFC please help] membarrier: Rewrite sync_core_before_usermode()

2020-12-28 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of December 29, 2020 10:36 am: > On Mon, Dec 28, 2020 at 4:11 PM Nicholas Piggin wrote: >> >> Excerpts from Andy Lutomirski's message of December 28, 2020 4:28 am: >> > The old sync_core_before_usermode() comments said tha

Re: [RFC please help] membarrier: Rewrite sync_core_before_usermode()

2020-12-29 Thread Nicholas Piggin
Excerpts from Russell King - ARM Linux admin's message of December 29, 2020 8:44 pm: > On Tue, Dec 29, 2020 at 01:09:12PM +1000, Nicholas Piggin wrote: >> I think it should certainly be documented in terms of what guarantees >> it provides to application, _not_ the kinds of in

Re: [RFC please help] membarrier: Rewrite sync_core_before_usermode()

2020-12-30 Thread Nicholas Piggin
Excerpts from Russell King - ARM Linux admin's message of December 30, 2020 8:58 pm: > On Wed, Dec 30, 2020 at 10:00:28AM +, Russell King - ARM Linux admin > wrote: >> On Wed, Dec 30, 2020 at 12:33:02PM +1000, Nicholas Piggin wrote: >> > Excerpts from Russell King -

Re: [PATCH v1 06/15] powerpc: Remove address and errorcode arguments from do_break()

2020-12-26 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of December 22, 2020 11:28 pm: > Let do_break() retrieve address and errorcode from regs. > > This simplifies the code and shouldn't impeed performance as > address and errorcode are likely still hot in the cache. > > S

Re: [PATCH v1 05/15] powerpc: Remove address argument from bad_page_fault()

2020-12-26 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of December 22, 2020 11:28 pm: > The address argument is not used by bad_page_fault(). > > Remove it. > > Suggested-by: Nicholas Piggin > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/bug.h |

Re: linux-next: build failure after merge of the akpm-current tree

2021-03-23 Thread Nicholas Piggin
Excerpts from Stephen Rothwell's message of March 24, 2021 6:58 am: > Hi all, > > On Thu, 18 Mar 2021 20:56:07 +1100 Stephen Rothwell > wrote: >> >> After merging the akpm-current tree, today's linux-next build (sparc >> defconfig) failed like this: >> >> In file included from arch/sparc/inclu

Re: [PATCH][next] mm/vmalloc: fix read of uninitialized pointer area

2021-03-21 Thread Nicholas Piggin
} > > Fix this by setting area to NULL to avoid the uninitialized read > of area. > > Addresses-Coverity: ("Uninitialized pointer read") > Fixes: 92db9fec381b ("mm/vmalloc: hugepage vmalloc mappings") > Signed-off-by: Colin Ian King Looks good to me.

Re: [PATCH v4 01/25] mm: Introduce struct folio

2021-03-21 Thread Nicholas Piggin
Excerpts from Matthew Wilcox's message of March 19, 2021 11:25 am: > On Fri, Mar 19, 2021 at 10:56:45AM +1100, Balbir Singh wrote: >> On Fri, Mar 05, 2021 at 04:18:37AM +, Matthew Wilcox (Oracle) wrote: >> > A struct folio refers to an entire (possibly compound) page. A function >> > which tak

Re: [PATCH 3/3] powerpc/qspinlock: Use generic smp_cond_load_relaxed

2021-03-15 Thread Nicholas Piggin
one looks at it? Something like this /* * smp_cond_load_relaxed was found to have performance problems if * implemented with spin_begin()/spin_end(). */ I wonder if it should have a Fixes: tag to the original commit as well. Otherwise, Acked-by: Nicholas Piggin Thanks, Nick > > Data is from three ben

Re: [PATCH v13 14/14] powerpc/64s/radix: Enable huge vmalloc mappings

2021-04-16 Thread Nicholas Piggin
Excerpts from Andrew Morton's message of April 16, 2021 4:55 am: > On Thu, 15 Apr 2021 12:23:55 +0200 Christophe Leroy > wrote: >> > + * is done. STRICT_MODULE_RWX may require extra work to support this >> > + * too. >> > + */ >> > >> > - return __vmalloc_node_range(size, 1, MODULES_VAD

Re: [PATCH v1 1/2] powerpc/bitops: Use immediate operand when possible

2021-04-13 Thread Nicholas Piggin
Excerpts from Segher Boessenkool's message of April 14, 2021 7:58 am: > On Tue, Apr 13, 2021 at 06:33:19PM +0200, Christophe Leroy wrote: >> Le 12/04/2021 à 23:54, Segher Boessenkool a écrit : >> >On Thu, Apr 08, 2021 at 03:33:44PM +, Christophe Leroy wrote: >> >>For clear bits, on 32 bits 'rlw

Re: [PATCH v2] powerpc/traps: Enhance readability for trap types

2021-04-01 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of April 1, 2021 12:39 pm: > Segher Boessenkool writes: >> On Wed, Mar 31, 2021 at 08:58:17PM +1100, Michael Ellerman wrote: >>> So perhaps: >>> >>> EXC_SYSTEM_RESET >>> EXC_MACHINE_CHECK >>> EXC_DATA_STORAGE >>> EXC_DATA_SEGMENT >>> EXC_INST_STO

Re: [PATCH v2] powerpc/traps: Enhance readability for trap types

2021-04-01 Thread Nicholas Piggin
Excerpts from Segher Boessenkool's message of April 2, 2021 2:11 am: > On Thu, Apr 01, 2021 at 10:55:58AM +0800, Xiongwei Song wrote: >> Segher Boessenkool 于2021年4月1日周四 上午6:15写道: >> >> > On Wed, Mar 31, 2021 at 08:58:17PM +1100, Michael Ellerman wrote: >> > > So perhaps: >> > > >> > > EXC_SYSTE

[PATCH] genirq: reduce irqdebug bouncing cachelines

2021-04-02 Thread Nicholas Piggin
306 25.473 0-1276.223 27.814 28.029 Signed-off-by: Nicholas Piggin --- kernel/irq/spurious.c | 4 1 file changed, 4 insertions(+) diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c index f865e5f4d382..c481d8458325 100644 --- a/kernel/irq/spurious.c +++ b/kernel/

[PATCH v13 00/14] huge vmalloc mappings

2021-03-16 Thread Nicholas Piggin
hs *** BLURB HERE *** Nicholas Piggin (14): ARM: mm: add missing pud_page define to 2-level page tables mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page mm: apply_to_pte_range warn and fail if a large pte is encountered mm/vmalloc: rename vmap_*_range vmap_

[PATCH v13 02/14] mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page

2021-03-16 Thread Nicholas Piggin
pings") Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 4f5f8c907897..98e697ac764c 10064

[PATCH v13 01/14] ARM: mm: add missing pud_page define to 2-level page tables

2021-03-16 Thread Nicholas Piggin
ARM uses its own PMD folding scheme which is missing pud_page which should just pass through to pmd_page. Move this from the 3-level page table to common header. Cc: Russell King Cc: Ding Tianhong Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Nicholas Piggin --- arch/arm/include/asm

[PATCH v13 05/14] mm/ioremap: rename ioremap_*_range to vmap_*_range

2021-03-16 Thread Nicholas Piggin
This will be used as a generic kernel virtual mapping function, so re-name it in preparation. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/ioremap.c | 64 +++- 1 file changed, 33 insertions(+), 31

[PATCH v13 03/14] mm: apply_to_pte_range warn and fail if a large pte is encountered

2021-03-16 Thread Nicholas Piggin
apply_to_pte_range might mistake a large pte for bad, or treat it as a page table, resulting in a crash or corruption. Add a test to warn and return error if large entries are found. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/memory.c | 66

[PATCH v13 06/14] mm: HUGE_VMAP arch support cleanup

2021-03-16 Thread Nicholas Piggin
d.org Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Reviewed-by: Ding Tianhong Acked-by: Catalin Marinas [arm64] Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/vmalloc.h | 8 ++ arch/arm64/mm/mmu.c

[PATCH v13 07/14] powerpc: inline huge vmap supported functions

2021-03-16 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 Acked-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/vmalloc.h

[PATCH v13 09/14] x86: inline huge vmap supported functions

2021-03-16 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: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Nicholas Piggin --- arch/

[PATCH v13 04/14] mm/vmalloc: rename vmap_*_range vmap_pages_*_range

2021-03-16 Thread Nicholas Piggin
The vmalloc mapper operates on a struct page * array rather than a linear physical address, re-name it to make this distinction clear. Reviewed-by: Miaohe Lin Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 1 file changed, 8 insertions

[PATCH v13 08/14] arm64: inline huge vmap supported functions

2021-03-16 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: Catalin Marinas Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org Acked-by: Catalin Marinas Signed-off-by: Nicholas Piggin --- arch/arm64/in

[PATCH v13 10/14] mm/vmalloc: provide fallback arch huge vmap support functions

2021-03-16 Thread Nicholas Piggin
If an architecture doesn't support a particular page table level as a huge vmap page size then allow it to skip defining the support query function. Suggested-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/vmalloc.h | 7 +++ arch/powerpc/includ

[PATCH v13 12/14] mm/vmalloc: add vmap_range_noflush variant

2021-03-16 Thread Nicholas Piggin
As a side-effect, the order of flush_cache_vmap() and arch_sync_kernel_mappings() calls are switched, but that now matches the other callers in this file. Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 +--- 1 file changed, 13 insertions(+), 3

[PATCH v13 13/14] mm/vmalloc: Hugepage vmalloc mappings

2021-03-16 Thread Nicholas Piggin
allocation, an option nohugevmalloc is added to disable at boot. Signed-off-by: Nicholas Piggin --- arch/Kconfig| 11 ++ include/linux/vmalloc.h | 21 mm/page_alloc.c | 5 +- mm/vmalloc.c| 216 +++- 4 files changed, 206

[PATCH v13 14/14] powerpc/64s/radix: Enable huge vmalloc mappings

2021-03-16 Thread Nicholas Piggin
This reduces TLB misses by nearly 30x on a `git diff` workload on a 2-node POWER9 (59,800 -> 2,100) and reduces CPU cycles by 0.54%, due to vfs hashes being allocated with 2MB pages. Cc: linuxppc-...@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- .../admin-gu

[PATCH v13 11/14] mm: Move vmap_range from mm/ioremap.c to mm/vmalloc.c

2021-03-16 Thread Nicholas Piggin
This is a generic kernel virtual memory mapper, not specific to ioremap. Code is unchanged other than making vmap_range non-static. Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- include/linux/vmalloc.h | 3 + mm/ioremap.c| 203

[PATCH v2] Increase page and bit waitqueue hash size

2021-03-17 Thread Nicholas Piggin
help reduce remote accesses on well localised workloads, but that adds some complexity with indexing and hotplug, so until we get a less artificial workload to test with, keep it simple. Signed-off-by: Nicholas Piggin --- kernel/sched/wait_bit.c | 30 +++--- mm/filemap.c

Re: [PATCH v2] Increase page and bit waitqueue hash size

2021-03-17 Thread Nicholas Piggin
Excerpts from Ingo Molnar's message of March 17, 2021 6:38 pm: > > * Nicholas Piggin wrote: > >> The page waitqueue hash is a bit small (256 entries) on very big systems. A >> 16 socket 1536 thread POWER9 system was found to encounter hash collisions >> and exc

Re: [PATCH v2] Increase page and bit waitqueue hash size

2021-03-17 Thread Nicholas Piggin
Excerpts from Rasmus Villemoes's message of March 17, 2021 8:12 pm: > On 17/03/2021 08.54, Nicholas Piggin wrote: > >> +#if CONFIG_BASE_SMALL >> +static const unsigned int page_wait_table_bits = 4; >> static wait_queue_head_t page_wait_table[PAGE_WAIT_TABLE_

Re: [PATCH v2] Increase page and bit waitqueue hash size

2021-03-17 Thread Nicholas Piggin
Excerpts from Linus Torvalds's message of March 18, 2021 5:26 am: > On Wed, Mar 17, 2021 at 3:44 AM Nicholas Piggin wrote: >> >> Argh, because I didn't test small. Sorry I had the BASE_SMALL setting in >> another patch and thought it would be a good idea to mash

Re: [PATCH v13 00/14] huge vmalloc mappings

2021-03-17 Thread Nicholas Piggin
Excerpts from Andrew Morton's message of March 18, 2021 8:58 am: > On Wed, 17 Mar 2021 16:23:48 +1000 Nicholas Piggin wrote: > >> >> *** BLURB HERE *** >> > > That's really not what it means ;) Sigh, wasn't having a good yesterday. > Cou

Re: [PATCH v4] powerpc/traps: Enhance readability for trap types

2021-04-09 Thread Nicholas Piggin
Thanks for working on this, I think it's a nice cleanup and helps non-powerpc people understand the code a bit better. Excerpts from Xiongwei Song's message of April 10, 2021 12:28 am: > From: Xiongwei Song > > Create a new header named traps.h, define macros to list ppc interrupt > types in tra

[PATCH 2/2] powerpc/64s: Trim offlined CPUs from mm_cpumasks

2020-11-19 Thread Nicholas Piggin
also prevents the cpumask from being trimmed back to local mode, which means continual broadcast IPIs or TLBIEs are needed for TLB flushing. This patch prevents that situation too. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/book3s/64/mmu.h | 12 arch/power

[PATCH 0/2] powerpc/64s: fix for CPU hotplug vs mm_cpumask bug

2020-11-19 Thread Nicholas Piggin
This fixes a race in powerpc mm_cpumask code, I hope the core kernel patch looks okay and we could take it through the powerpc tree with an ack from someone (Peter or Thomas, perhaps?) Thanks, Nick Nicholas Piggin (2): kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling

[PATCH 1/2] kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling

2020-11-19 Thread Nicholas Piggin
ned-off-by: Nicholas Piggin --- kernel/cpu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index 6ff2578ecf17..2b8d7a5db383 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -815,6 +815,10 @@ void __init cpuhp_threads_init(void) }

Re: [RFC v2 1/2] [NEEDS HELP] x86/mm: Handle unlazying membarrier core sync in the arch code

2020-12-03 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of December 4, 2020 3:26 pm: > The core scheduler isn't a great place for > membarrier_mm_sync_core_before_usermode() -- the core scheduler doesn't > actually know whether we are lazy. With the old code, if a CPU is > running a membarrier-registered task, go

Re: [RFC v2 2/2] [MOCKUP] sched/mm: Lightweight lazy mm refcounting

2020-12-03 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of December 4, 2020 3:26 pm: > This is a mockup. It's designed to illustrate the algorithm and how the > code might be structured. There are several things blatantly wrong with > it: > > The coding stype is not up to kernel standards. I have prototypes in

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

2020-12-04 Thread Nicholas Piggin
Excerpts from Edgecombe, Rick P's message of December 1, 2020 6:21 am: > On Sun, 2020-11-29 at 01:25 +1000, Nicholas Piggin wrote: >> Support huge page vmalloc mappings. Config option >> HAVE_ARCH_HUGE_VMALLOC >> enables support on architectures that define HAVE_ARCH_HUG

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

2020-12-04 Thread Nicholas Piggin
Excerpts from Edgecombe, Rick P's message of December 5, 2020 4:33 am: > On Fri, 2020-12-04 at 18:12 +1000, Nicholas Piggin wrote: >> Excerpts from Edgecombe, Rick P's message of December 1, 2020 6:21 >> am: >> > On Sun, 2020-11-29 at 01:25 +1000, Nicholas Pigg

Re: [RFC v2 2/2] [MOCKUP] sched/mm: Lightweight lazy mm refcounting

2020-12-04 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of December 5, 2020 12:37 am: > > >> On Dec 3, 2020, at 11:54 PM, Nicholas Piggin wrote: >> >> Excerpts from Andy Lutomirski's message of December 4, 2020 3:26 pm: >>> This is a mockup. It's designed

[PATCH v9 02/12] mm: apply_to_pte_range warn and fail if a large pte is encountered

2020-12-04 Thread Nicholas Piggin
apply_to_pte_range might mistake a large pte for bad, or treat it as a page table, resulting in a crash or corruption. Add a test to warn and return error if large entries are found. Signed-off-by: Nicholas Piggin --- mm/memory.c | 66 +++-- 1

[PATCH v9 03/12] mm/vmalloc: rename vmap_*_range vmap_pages_*_range

2020-12-04 Thread Nicholas Piggin
The vmalloc mapper operates on a struct page * array rather than a linear physical address, re-name it to make this distinction clear. Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c

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

2020-12-04 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 Acked-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/vmalloc.h

[PATCH v9 04/12] mm/ioremap: rename ioremap_*_range to vmap_*_range

2020-12-04 Thread Nicholas Piggin
This will be used as a generic kernel virtual mapping function, so re-name it in preparation. Signed-off-by: Nicholas Piggin --- mm/ioremap.c | 64 +++- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/mm/ioremap.c b/mm/ioremap.c

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

2020-12-04 Thread Nicholas Piggin
d.org Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Acked-by: Catalin Marinas [arm64] Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/vmalloc.h | 8 +++ arch/arm64/mm/mmu.c | 10 +-- arch/powe

[PATCH v9 08/12] x86: inline huge vmap supported functions

2020-12-04 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: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Nicholas Piggin --- arch/

[PATCH v9 10/12] mm/vmalloc: add vmap_range_noflush variant

2020-12-04 Thread Nicholas Piggin
As a side-effect, the order of flush_cache_vmap() and arch_sync_kernel_mappings() calls are switched, but that now matches the other callers in this file. Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mm

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

2020-12-04 Thread Nicholas Piggin
misses by nearly 30x on a `git diff` workload on a 2-node POWER9 (59,800 -> 2,100) and reduces 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 Pig

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

2020-12-04 Thread Nicholas Piggin
pings") Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 6ae491a8b210..f85124e88bdb 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -34,7 +34,7 @@

[PATCH v9 07/12] arm64: inline huge vmap supported functions

2020-12-04 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: Catalin Marinas Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org Acked-by: Catalin Marinas Signed-off-by: Nicholas Piggin --- arch/arm64/in

[PATCH v9 12/12] powerpc/64s/radix: Enable huge vmalloc mappings

2020-12-04 Thread Nicholas Piggin
Cc: linuxppc-...@lists.ozlabs.org Signed-off-by: Nicholas Piggin --- Documentation/admin-guide/kernel-parameters.txt | 2 ++ arch/powerpc/Kconfig| 1 + arch/powerpc/kernel/module.c| 13 +++-- 3 files changed, 14 insertions(+), 2 deletions

[PATCH v9 00/12] huge vmalloc mappings

2020-12-04 Thread Nicholas Piggin
Since v2: - Rebased on vmalloc cleanups, split series into simpler pieces. - Fixed several compile errors and warnings - Keep the page array and accounting in small page units because struct vm_struct is an interface (this should fix x86 vmap stack debug assert). [Thanks Zefan] Nicholas Piggi

[PATCH v9 09/12] mm: Move vmap_range from mm/ioremap.c to mm/vmalloc.c

2020-12-04 Thread Nicholas Piggin
This is a generic kernel virtual memory mapper, not specific to ioremap. Signed-off-by: Nicholas Piggin --- include/linux/vmalloc.h | 3 + mm/ioremap.c| 197 mm/vmalloc.c| 196 +++ 3 files

Re: [PATCH 2/8] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-12-05 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of December 3, 2020 3:09 pm: > On Tue, Dec 1, 2020 at 6:50 PM Nicholas Piggin wrote: >> >> Excerpts from Andy Lutomirski's message of November 29, 2020 3:55 am: >> > On Sat, Nov 28, 2020 at 8:02 AM Nicholas Piggin wro

Re: [PATCH 2/8] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-12-05 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of December 6, 2020 2:11 am: > >> On Dec 5, 2020, at 12:00 AM, Nicholas Piggin wrote: >> >> >> I disagree. Until now nobody following it noticed that the mm gets >> un-lazied in other cases, because that wa

Re: [PATCH 2/8] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-12-05 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of December 6, 2020 10:36 am: > On Sat, Dec 5, 2020 at 3:15 PM Nicholas Piggin wrote: >> >> Excerpts from Andy Lutomirski's message of December 6, 2020 2:11 am: >> > > >> If an mm was lazy tlb for a kernel t

Re: [PATCH 5/8] lazy tlb: allow lazy tlb mm switching to be configurable

2020-12-01 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of November 29, 2020 10:36 am: > On Sat, Nov 28, 2020 at 8:02 AM Nicholas Piggin wrote: >> >> NOMMU systems could easily go without this and save a bit of code >> and the refcount atomics, because their mm switch is a no-op. I &g

Re: [PATCH 2/8] x86: use exit_lazy_tlb rather than membarrier_mm_sync_core_before_usermode

2020-12-01 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of November 29, 2020 3:55 am: > On Sat, Nov 28, 2020 at 8:02 AM Nicholas Piggin wrote: >> >> And get rid of the generic sync_core_before_usermode facility. This is >> functionally a no-op in the core scheduler code, but it also ca

Re: [PATCH 1/8] lazy tlb: introduce exit_lazy_tlb

2020-12-01 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of November 29, 2020 10:38 am: > On Sat, Nov 28, 2020 at 8:01 AM Nicholas Piggin wrote: >> >> This is called at points where a lazy mm is switched away or made not >> lazy (by its owner switching back). >> >> Signed-of

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

2020-12-01 Thread Nicholas Piggin
Excerpts from Andy Lutomirski's message of November 29, 2020 1:54 pm: > On Sat, Nov 28, 2020 at 8:02 AM Nicholas Piggin wrote: >> >> On big systems, the mm refcount can become highly contented when doing >> a lot of context switching with threaded applications (particu

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

2020-12-01 Thread Nicholas Piggin
ote: >> >> On Sat, Nov 28, 2020 at 7:54 PM Andy Lutomirski wrote: >> > >> > On Sat, Nov 28, 2020 at 8:02 AM Nicholas Piggin wrote: >> > > >> > > On big systems, the mm refcount can become highly contented when doing >> > > a lot

Re: [MOCKUP] x86/mm: Lightweight lazy mm refcounting

2020-12-03 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of December 3, 2020 6:44 pm: > On Wed, Dec 02, 2020 at 09:25:51PM -0800, Andy Lutomirski wrote: > >> power: same as ARM, except that the loop may be rather larger since >> the systems are bigger. But I imagine it's still faster than Nick's >> approach -- a c

Re: [PATCH] [RFC] arm64: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION

2021-02-28 Thread Nicholas Piggin
se up by using > non-magic start/stop symbols for all sections, and relying on KEEP() > instead where needed. > >> There are a lot of KEEP usage. Perhaps some can be dropped to facilitate >> ld --gc-sections. > > I see a lot of these were added by Nick Piggin (added

Re: [PATCH v2 36/43] powerpc/32: Set current->thread.regs in C interrupt entry

2021-03-11 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 11, 2021 10:38 pm: > > > Le 11/03/2021 à 11:38, Christophe Leroy a écrit : >> >> >> Le 10/03/2021 à 02:33, Nicholas Piggin a écrit : >>> Excerpts from Christophe Leroy's message of March 9, 2021 10:

Re: [PATCH v5 05/22] powerpc/irq: Add helper to set regs->softe

2021-03-08 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 5, 2021 6:54 pm: > > > Le 09/02/2021 à 08:49, Nicholas Piggin a écrit : >> Excerpts from Christophe Leroy's message of February 9, 2021 4:18 pm: >>> >>> >>> Le 09/02/2021 à 02:11, Nicholas Pi

Re: [PATCH v2 01/43] powerpc/traps: unrecoverable_exception() is not an interrupt handler

2021-03-09 Thread Nicholas Piggin
user time accounting). > > Fixes: 3a96570ffceb ("powerpc: convert interrupt handlers to use wrappers") > Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin This should go in as a fix for this release I think. > --- > arch/powerpc/include/asm/interrupt.h | 3 ++

Re: [PATCH v2 02/43] powerpc/traps: Declare unrecoverable_exception() as __noreturn

2021-03-09 Thread Nicholas Piggin
ough here and fall through again and warn again, etc. Putting the infinite loop is good enough I think (and better than there was previously). Otherwise Reviewed-by: Nicholas Piggin Thanks, Nick

Re: [PATCH v2 28/43] powerpc/64e: Call bad_page_fault() from do_page_fault()

2021-03-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 9, 2021 10:09 pm: > book3e/64 is the last one calling __bad_page_fault() > from assembly. > > Save non volatile registers before calling do_page_fault() > and modify do_page_fault() to call __bad_page_fault() > for all platforms. > > Then it can b

Re: [PATCH v2 36/43] powerpc/32: Set current->thread.regs in C interrupt entry

2021-03-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 9, 2021 10:10 pm: > No need to do that is assembly, do it in C. Hmm. No issues with the patch as such, but why does ppc32 need this but not 64? AFAIKS 64 sets this when a thread is created. Thanks, Nick > > Signed-off-by: Christophe Leroy > --

Re: [PATCH v2 40/43] powerpc/64s: Make kuap_check_amr() and kuap_get_and_check_amr() generic

2021-03-09 Thread Nicholas Piggin
tub > for when CONFIG_PPC_KUAP is not selected. Looks pretty straightforward to me. While you're renaming things, could kuap_check_amr() be changed to kuap_assert_locked() or similar? Otherwise, Reviewed-by: Nicholas Piggin > > Signed-off-by: Christophe Leroy > --- > arch/powerp

Re: [PATCH v2 1/1] powerpc/kvm: Save Timebase Offset to fix sched_clock() while running guest code.

2021-02-05 Thread Nicholas Piggin
Excerpts from Leonardo Bras's message of February 5, 2021 5:01 pm: > Hey Nick, thanks for reviewing :) > > On Fri, 2021-02-05 at 16:28 +1000, Nicholas Piggin wrote: >> Excerpts from Leonardo Bras's message of February 5, 2021 4:06 pm: >> > Before guest entry, TB

Re: [PATCH] powerpc/8xx: Fix software emulation interrupt

2021-02-05 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 5, 2021 6:56 pm: > For unimplemented instructions or unimplemented SPRs, the 8xx triggers > a "Software Emulation Exception" (0x1000). That interrupt doesn't set > reason bits in SRR1 as the "Program Check Exception" does. > > Go through emulati

RE: [PATCH v10 11/12] mm/vmalloc: Hugepage vmalloc mappings

2021-01-26 Thread Nicholas Piggin
Excerpts from David Laight's message of January 25, 2021 10:24 pm: > From: Christophe Leroy >> Sent: 25 January 2021 09:15 >> >> Le 24/01/2021 à 09:22, Nicholas Piggin a écrit : >> > Support huge page vmalloc mappings. Config option HAVE_ARCH_HUGE_VMALLOC &g

Re: [PATCH v4 20/23] powerpc/syscall: Do not check unsupported scv vector on PPC32

2021-01-26 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of January 26, 2021 12:48 am: > Only PPC64 has scv. No need to check the 0x7ff0 trap on PPC32. > > And ignore the scv parameter in syscall_exit_prepare (Save 14 cycles > 346 => 332 cycles) > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/kernel/e

Re: [PATCH v4 11/23] powerpc/syscall: Rename syscall_64.c into syscall.c

2021-01-26 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of January 26, 2021 12:48 am: > syscall_64.c will be reused almost as is for PPC32. > > Rename it syscall.c Could you rename it to interrupt.c instead? A system call is an interrupt, and the file now also has code to return from other interrupts as well,

Re: [PATCH v11 12/13] mm/vmalloc: Hugepage vmalloc mappings

2021-01-26 Thread Nicholas Piggin
Excerpts from Ding Tianhong's message of January 26, 2021 4:59 pm: > On 2021/1/26 12:45, 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 >> suppor

Re: [PATCH v4 14/23] powerpc/syscall: Save r3 in regs->orig_r3

2021-01-26 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of January 26, 2021 12:48 am: > Save r3 in regs->orig_r3 in system_call_exception() > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/kernel/entry_64.S | 1 - > arch/powerpc/kernel/syscall.c | 2 ++ > 2 files changed, 2 insertions(+), 1 deletion(-

Re: [PATCH v4 19/23] powerpc/syscall: Avoid stack frame in likely part of system_call_exception()

2021-01-26 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of January 26, 2021 12:48 am: > When r3 is not modified, reload it from regs->orig_r3 to free > volatile registers. This avoids a stack frame for the likely part > of system_call_exception() > > Before the patch: > > c000b4d4 : > c000b4d4: 7c 08 02 a6

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

2021-01-26 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of January 25, 2021 7:14 pm: > > > Le 24/01/2021 à 09:22, Nicholas Piggin a écrit : >> Support huge page vmalloc mappings. Config option HAVE_ARCH_HUGE_VMALLOC >> enables support on architectures that define HAVE_ARCH_HUGE_VMAP

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

2021-01-26 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of January 25, 2021 6:42 pm: > > > Le 24/01/2021 à 09:22, Nicholas Piggin a écrit : >> This allows unsupported levels to be constant folded away, and so >> p4d_free_pud_page can be removed because it's no longer linked t

[PATCH v11 02/13] mm: apply_to_pte_range warn and fail if a large pte is encountered

2021-01-26 Thread Nicholas Piggin
apply_to_pte_range might mistake a large pte for bad, or treat it as a page table, resulting in a crash or corruption. Add a test to warn and return error if large entries are found. Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/memory.c | 66

[PATCH v11 04/13] mm/ioremap: rename ioremap_*_range to vmap_*_range

2021-01-26 Thread Nicholas Piggin
This will be used as a generic kernel virtual mapping function, so re-name it in preparation. Signed-off-by: Nicholas Piggin --- mm/ioremap.c | 64 +++- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/mm/ioremap.c b/mm/ioremap.c

[PATCH v11 05/13] mm: HUGE_VMAP arch support cleanup

2021-01-26 Thread Nicholas Piggin
d.org Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x...@kernel.org Cc: "H. Peter Anvin" Acked-by: Catalin Marinas [arm64] Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/vmalloc.h | 8 ++ arch/arm64/mm/mmu.c | 10 +-- arch/powe

[PATCH v11 03/13] mm/vmalloc: rename vmap_*_range vmap_pages_*_range

2021-01-26 Thread Nicholas Piggin
The vmalloc mapper operates on a struct page * array rather than a linear physical address, re-name it to make this distinction clear. Reviewed-by: Christoph Hellwig Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff

<    1   2   3   4   5   6   7   8   9   10   >