Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-09-05 Thread Kirill A. Shutemov
On Thu, Aug 29, 2024 at 12:15:57AM -0700, Charlie Jenkins wrote: > Some applications rely on placing data in free bits addresses allocated > by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the > address returned by mmap to be less than the 48-bit address space, > unless the hint a

Re: [PATCH v2 07/14] mm: khugepaged: collapse_pte_mapped_thp() use pte_offset_map_rw_nolock()

2024-09-05 Thread Muchun Song
> On Sep 5, 2024, at 14:41, Qi Zheng wrote: > > > > On 2024/9/5 14:32, Muchun Song wrote: >>> On Aug 30, 2024, at 14:54, Qi Zheng wrote: >>> >>> >>> >>> On 2024/8/29 16:10, Muchun Song wrote: On 2024/8/22 15:13, Qi Zheng wrote: > In collapse_pte_mapped_thp(), we may modify the p

[PATCH] soc: fsl: qe: ucc: Export ucc_mux_set_grant_tsa_bkpt

2024-09-05 Thread Herve Codina
When TSA is compiled as module the following error is reported: "ucc_mux_set_grant_tsa_bkpt" [drivers/soc/fsl/qe/tsa.ko] undefined! Indeed, the ucc_mux_set_grant_tsa_bkpt symbol is not exported. Simply export ucc_mux_set_grant_tsa_bkpt. Reported-by: kernel test robot Closes: https://lore.ker

Re: [PATCH] soc: fsl: qe: ucc: Export ucc_mux_set_grant_tsa_bkpt

2024-09-05 Thread Christophe Leroy
Le 05/09/2024 à 09:22, Herve Codina a écrit : When TSA is compiled as module the following error is reported: "ucc_mux_set_grant_tsa_bkpt" [drivers/soc/fsl/qe/tsa.ko] undefined! Indeed, the ucc_mux_set_grant_tsa_bkpt symbol is not exported. Simply export ucc_mux_set_grant_tsa_bkpt. Repor

Re: [PATCH v5 3/4] arm64: topology: Support SMT control on ACPI based system

2024-09-05 Thread Pierre Gondois
Hello Yicong, Wondering if we can avoid this 2nd loop. Greg express the worries of looping twice on large scale system in v1. Maybe we could use the hetero_id and get the necessary information in one loop, I need further think. I found this comments (not sure this is what you are refering to

Re: [PATCH] kexec/crash: no crash update when kexec in progress

2024-09-05 Thread Sourabh Jain
Hello Baoquan, On 05/09/24 08:53, Baoquan He wrote: On 09/04/24 at 02:55pm, Sourabh Jain wrote: Hello Baoquan, On 30/08/24 16:47, Baoquan He wrote: On 08/20/24 at 12:10pm, Sourabh Jain wrote: Hello Baoquan, ..snip... 2. A patch to return early from the `crash_handle_hotplug_event()` f

Re: [PATCH v3 08/14] mm: copy_pte_range() use pte_offset_map_rw_nolock()

2024-09-05 Thread Muchun Song
On 2024/9/4 16:40, Qi Zheng wrote: In copy_pte_range(), we may modify the src_pte entry after holding the src_ptl, so convert it to using pte_offset_map_rw_nolock(). Since we may free the PTE page in retract_page_tables() without holding the read lock of mmap_lock, so we still need to get pmdv

Re: [PATCH 4/5] x86: perf: Refactor misc flag assignments

2024-09-05 Thread Ingo Molnar
* Colton Lewis wrote: > Break the assignment logic for misc flags into their own respective > functions to reduce the complexity of the nested logic. > > Signed-off-by: Colton Lewis > --- > arch/x86/events/core.c| 31 +++ > arch/x86/include/asm/perf_ev

Re: [PATCH] soc: fsl: qe: ucc: Export ucc_mux_set_grant_tsa_bkpt

2024-09-05 Thread Arnd Bergmann
On Thu, Sep 5, 2024, at 07:31, Christophe Leroy wrote: > Le 05/09/2024 à 09:22, Herve Codina a écrit : >> When TSA is compiled as module the following error is reported: >>"ucc_mux_set_grant_tsa_bkpt" [drivers/soc/fsl/qe/tsa.ko] undefined! >> >> Indeed, the ucc_mux_set_grant_tsa_bkpt symbol is

[PATCH v2 RESEND] tpm: export tpm2_sessions_init() to fix ibmvtpm building

2024-09-05 Thread Kexy Biscuit
Commit 08d08e2e9f0a ("tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support") adds call to tpm2_sessions_init() in ibmvtpm, which could be built as a module. However, tpm2_sessions_init() wasn't exported, causing libmvtpm to fail to build as a module: ERROR: modpost: "tpm2_sessions

Re: [PATCH v3 09/14] mm: mremap: move_ptes() use pte_offset_map_rw_nolock()

2024-09-05 Thread Muchun Song
On 2024/9/4 16:40, Qi Zheng wrote: In move_ptes(), we may modify the new_pte after acquiring the new_ptl, so convert it to using pte_offset_map_rw_nolock(). Since we may free the PTE page in retract_page_tables() without holding the read lock of mmap_lock, so we still need to do a pmd_same() c

Re: [PATCH 2/5] perf: Hoist perf_instruction_pointer() and perf_misc_flags()

2024-09-05 Thread Ingo Molnar
* Colton Lewis wrote: > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -6915,6 +6915,16 @@ void perf_unregister_guest_info_callbacks(struct > perf_guest_info_callbacks *cbs) > EXPORT_SYMBOL_GPL(perf_unregister_guest_info_callbacks); > #endif > > +unsigned long perf_misc_flags

Re: [PATCH 1/5] arm: perf: Drop unused functions

2024-09-05 Thread Mark Rutland
On Wed, Sep 04, 2024 at 08:41:29PM +, Colton Lewis wrote: > perf_instruction_pointer() and perf_misc_flags() aren't used anywhere > in this particular perf implementation. Drop them. I think it'd be better to say that arch/arm's implementation of these is equivalent to the generic versions in

Re: [PATCH v2] mm: z3fold: deprecate CONFIG_Z3FOLD

2024-09-05 Thread Johannes Weiner
On Wed, Sep 04, 2024 at 11:33:43PM +, Yosry Ahmed wrote: > The z3fold compressed pages allocator is rarely used, most users use > zsmalloc. The only disadvantage of zsmalloc in comparison is the > dependency on MMU, and zbud is a more common option for !MMU as it was > the default zswap allocat

Re: [PATCH v2] mm: z3fold: deprecate CONFIG_Z3FOLD

2024-09-05 Thread Vitaly Wool
On Thu, Sep 5, 2024 at 1:33 AM Yosry Ahmed wrote: > > The z3fold compressed pages allocator is rarely used, most users use > zsmalloc. The only disadvantage of zsmalloc in comparison is the > dependency on MMU, and zbud is a more common option for !MMU as it was > the default zswap allocator for a

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-05 Thread Joey Gouly
On Wed, Sep 04, 2024 at 05:17:58PM +0100, Will Deacon wrote: > On Wed, Sep 04, 2024 at 01:55:03PM +0100, Joey Gouly wrote: > > On Wed, Sep 04, 2024 at 12:43:02PM +0100, Will Deacon wrote: > > > Right, there's quite a lot I need to do: > > > > > > - Uncorrupt your patches > > > - Fix the conflict i

Re: [PATCH v3 08/14] mm: copy_pte_range() use pte_offset_map_rw_nolock()

2024-09-05 Thread Qi Zheng
On 2024/9/5 16:57, Muchun Song wrote: On 2024/9/4 16:40, Qi Zheng wrote: In copy_pte_range(), we may modify the src_pte entry after holding the src_ptl, so convert it to using pte_offset_map_rw_nolock(). Since we may free the PTE page in retract_page_tables() without holding the read lock o

Re: [PATCH 5/5] perf: Correct perf sampling with guest VMs

2024-09-05 Thread Mark Rutland
On Wed, Sep 04, 2024 at 08:41:33PM +, Colton Lewis wrote: > Previously any PMU overflow interrupt that fired while a VCPU was > loaded was recorded as a guest event whether it truly was or not. This > resulted in nonsense perf recordings that did not honor > perf_event_attr.exclude_guest and re

Re: [PATCH v3 09/14] mm: mremap: move_ptes() use pte_offset_map_rw_nolock()

2024-09-05 Thread Qi Zheng
On 2024/9/5 17:25, Muchun Song wrote: On 2024/9/4 16:40, Qi Zheng wrote: In move_ptes(), we may modify the new_pte after acquiring the new_ptl, so convert it to using pte_offset_map_rw_nolock(). Since we may free the PTE page in retract_page_tables() without holding the read lock of mmap_lo

Re: [PATCH v5 3/4] arm64: topology: Support SMT control on ACPI based system

2024-09-05 Thread Yicong Yang
On 2024/9/5 16:34, Pierre Gondois wrote: > Hello Yicong, > Wondering if we can avoid this 2nd loop. Greg express the worries of looping twice on large scale system in v1. Maybe we could use the hetero_id and get the necessary information in one loop, I need further think

Re: [PATCH v3 10/14] mm: page_vma_mapped_walk: map_pte() use pte_offset_map_rw_nolock()

2024-09-05 Thread Muchun Song
On 2024/9/4 16:40, Qi Zheng wrote: In the caller of map_pte(), we may modify the pvmw->pte after acquiring the pvmw->ptl, so convert it to using pte_offset_map_rw_nolock(). At this time, the pte_same() check is not performed after the pvmw->ptl held, so we should get pmdval and do pmd_same() c

Re: [PATCH v5 0/5] Wire up getrandom() vDSO implementation on powerpc

2024-09-05 Thread Michael Ellerman
"Jason A. Donenfeld" writes: > Hi Christophe, Michael, > > On Mon, Sep 02, 2024 at 09:17:17PM +0200, Christophe Leroy wrote: >> This series wires up getrandom() vDSO implementation on powerpc. >> >> Tested on PPC32 on real hardware. >> Tested on PPC64 (both BE and LE) on QEMU: >> >> Performance

Re: [PATCH v3 11/14] mm: userfaultfd: move_pages_pte() use pte_offset_map_rw_nolock()

2024-09-05 Thread Muchun Song
> On Sep 4, 2024, at 16:40, Qi Zheng wrote: > > In move_pages_pte(), we may modify the dst_pte and src_pte after acquiring > the ptl, so convert it to using pte_offset_map_rw_nolock(). But since we > already do the pte_same() check, there is no need to get pmdval to do > pmd_same() check, just

Re: [PATCH v3 12/14] mm: multi-gen LRU: walk_pte_range() use pte_offset_map_rw_nolock()

2024-09-05 Thread Muchun Song
> On Sep 4, 2024, at 16:40, Qi Zheng wrote: > > In walk_pte_range(), we may modify the pte entry after holding the ptl, so > convert it to using pte_offset_map_rw_nolock(). At this time, the > pte_same() check is not performed after the ptl held, so we should get > pmdval and do pmd_same() che

Re: [PATCH 13/15] powerpc/rtas: Use fsleep() to minimize additional sleep duration

2024-09-05 Thread Michael Ellerman
Anna-Maria Behnsen writes: > When commit 38f7b7067dae ("powerpc/rtas: rtas_busy_delay() improvements") > was introduced, documentation about proper usage of sleep realted functions > was outdated. > ... > Use fsleep() directly instead of using an own heuristic for the best > sleeping mechanism to

Re: [PATCH v3 13/14] mm: pgtable: remove pte_offset_map_nolock()

2024-09-05 Thread Muchun Song
> On Sep 4, 2024, at 16:40, Qi Zheng wrote: > > Now no users are using the pte_offset_map_nolock(), remove it. > > Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Thanks.

Re: [PATCH v5 0/5] Wire up getrandom() vDSO implementation on powerpc

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 05, 2024 at 10:18:40PM +1000, Michael Ellerman wrote: > There is an existing comment in the a/p/vdso/Makefile about the > fixed-r30 thing, tldr is it's a workaround to avoid breaking old > versions of Go. Thanks. Indeed, following Christophe's links yesterday, I tumbled down that rabbi

Re: [PATCH v2] powerpc/pseries/eeh: Fix pseries_eeh_err_inject

2024-09-05 Thread Michael Ellerman
Narayana Murty N writes: > VFIO_EEH_PE_INJECT_ERR ioctl is currently failing on pseries > due to missing implementation of err_inject eeh_ops for pseries. > This patch implements pseries_eeh_err_inject in eeh_ops/pseries > eeh_ops. Implements support for injecting MMIO load/store error > for testi

Re: [PATCH v2 RESEND] tpm: export tpm2_sessions_init() to fix ibmvtpm building

2024-09-05 Thread Jarkko Sakkinen
On Thu Sep 5, 2024 at 11:52 AM EEST, Kexy Biscuit wrote: > Commit 08d08e2e9f0a ("tpm: ibmvtpm: Call tpm2_sessions_init() to > initialize session support") adds call to tpm2_sessions_init() in ibmvtpm, > which could be built as a module. However, tpm2_sessions_init() wasn't > exported, causing libmv

Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32

2024-09-05 Thread Jason A. Donenfeld
> +/* > + * The macro sets two stack frames, one for the caller and one for the callee > + * because there are no requirement for the caller to set a stack frame when > + * calling VDSO so it may have omitted to set one, especially on PPC64 > + */ > + > +.macro cvdso_call funct > + .cfi_startproc

Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 05, 2024 at 06:13:29PM +0200, Jason A. Donenfeld wrote: > > +/* > > + * The macro sets two stack frames, one for the caller and one for the > > callee > > + * because there are no requirement for the caller to set a stack frame > > when > > + * calling VDSO so it may have omitted to s

Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32

2024-09-05 Thread Christophe Leroy
Le 05/09/2024 à 18:13, Jason A. Donenfeld a écrit : +/* + * The macro sets two stack frames, one for the caller and one for the callee + * because there are no requirement for the caller to set a stack frame when + * calling VDSO so it may have omitted to set one, especially on PPC64 + */ + +.

Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 05, 2024 at 06:55:27PM +0200, Christophe Leroy wrote: > > > Le 05/09/2024 à 18:13, Jason A. Donenfeld a écrit : > >> +/* > >> + * The macro sets two stack frames, one for the caller and one for the > >> callee > >> + * because there are no requirement for the caller to set a stack fr

Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 05, 2024 at 07:03:34PM +0200, Jason A. Donenfeld wrote: > On Thu, Sep 05, 2024 at 06:55:27PM +0200, Christophe Leroy wrote: > > > > > > Le 05/09/2024 à 18:13, Jason A. Donenfeld a écrit : > > >> +/* > > >> + * The macro sets two stack frames, one for the caller and one for the > > >>

Re: [PATCH RFC v2 0/4] mm: Introduce MAP_BELOW_HINT

2024-09-05 Thread Charlie Jenkins
On Thu, Sep 05, 2024 at 09:47:47AM +0300, Kirill A. Shutemov wrote: > On Thu, Aug 29, 2024 at 12:15:57AM -0700, Charlie Jenkins wrote: > > Some applications rely on placing data in free bits addresses allocated > > by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the > > address re

Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 05, 2024 at 06:13:29PM +0200, Jason A. Donenfeld wrote: > > +/* > > + * The macro sets two stack frames, one for the caller and one for the > > callee > > + * because there are no requirement for the caller to set a stack frame > > when > > + * calling VDSO so it may have omitted to s

[PATCH RFC v3 0/2] mm: Introduce ADDR_LIMIT_47BIT personality flag

2024-09-05 Thread Charlie Jenkins
Some applications rely on placing data in free bits addresses allocated by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the address returned by mmap to be less than the 48-bit address space, unless the hint address uses more than 47 bits (the 48th bit is reserved for the kernel ad

[PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-05 Thread Charlie Jenkins
Create a personality flag ADDR_LIMIT_47BIT to support applications that wish to transition from running in environments that support at most 47-bit VAs to environments that support larger VAs. This personality can be set to cause all allocations to be below the 47-bit boundary. Using MAP_FIXED with

[PATCH RFC v3 2/2] selftests/mm: Create ADDR_LIMIT_47BIT test

2024-09-05 Thread Charlie Jenkins
Add a selftest for the ADDR_LIMIT_47BIT personality flag that mmaps until it runs out of space and ensures no addresses are allocated above 47 bits. Signed-off-by: Charlie Jenkins --- tools/testing/selftests/mm/.gitignore | 1 + tools/testing/selftests/mm/Makefile|

Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32

2024-09-05 Thread Xi Ruoyao
On Thu, 2024-09-05 at 18:55 +0200, Christophe Leroy wrote: > > Normal single thread > > vdso: 2500 times in 12.494133131 seconds > > libc: 2500 times in 69.594625188 seconds > > syscall: 2500 times in 67.349243972 seconds > > Time namespace single thread > > vdso: 250

Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32

2024-09-05 Thread Jason A. Donenfeld
On Thu, Sep 05, 2024 at 10:41:40PM +0200, Jason A. Donenfeld wrote: > On Thu, Sep 05, 2024 at 06:13:29PM +0200, Jason A. Donenfeld wrote: > > > +/* > > > + * The macro sets two stack frames, one for the caller and one for the > > > callee > > > + * because there are no requirement for the caller t

Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32

2024-09-05 Thread Jason A. Donenfeld
On Fri, Sep 06, 2024 at 04:48:28AM +0200, Jason A. Donenfeld wrote: > On Thu, Sep 05, 2024 at 10:41:40PM +0200, Jason A. Donenfeld wrote: > > On Thu, Sep 05, 2024 at 06:13:29PM +0200, Jason A. Donenfeld wrote: > > > > +/* > > > > + * The macro sets two stack frames, one for the caller and one for t

Re: [PATCH v2] mm: z3fold: deprecate CONFIG_Z3FOLD

2024-09-05 Thread Miaohe Lin
On 2024/9/5 7:33, Yosry Ahmed wrote: > The z3fold compressed pages allocator is rarely used, most users use > zsmalloc. The only disadvantage of zsmalloc in comparison is the > dependency on MMU, and zbud is a more common option for !MMU as it was > the default zswap allocator for a long time. > >

Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32

2024-09-05 Thread Christophe Leroy
Hi Jason, Le 06/09/2024 à 05:24, Jason A. Donenfeld a écrit : On Fri, Sep 06, 2024 at 04:48:28AM +0200, Jason A. Donenfeld wrote: On Thu, Sep 05, 2024 at 10:41:40PM +0200, Jason A. Donenfeld wrote: On Thu, Sep 05, 2024 at 06:13:29PM +0200, Jason A. Donenfeld wrote: +/* + * The macro sets two

Re: [PATCH RFC v3 0/2] mm: Introduce ADDR_LIMIT_47BIT personality flag

2024-09-05 Thread Guo Ren
On Fri, Sep 6, 2024 at 5:16 AM Charlie Jenkins wrote: > > Some applications rely on placing data in free bits addresses allocated > by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the > address returned by mmap to be less than the 48-bit address space, > unless the hint address u

Re: [PATCH 10/13] fs/dax: Properly refcount fs dax pages

2024-09-05 Thread Alistair Popple
Christoph Hellwig writes: >> diff --git a/drivers/dax/device.c b/drivers/dax/device.c >> index eb61598..b7a31ae 100644 >> --- a/drivers/dax/device.c >> +++ b/drivers/dax/device.c >> @@ -126,11 +126,11 @@ static vm_fault_t __dev_dax_pte_fault(struct dev_dax >> *dev_dax, >> return V

Re: [PATCH RFC v3 0/2] mm: Introduce ADDR_LIMIT_47BIT personality flag

2024-09-05 Thread John Paul Adrian Glaubitz
Hi Charlie, On Thu, 2024-09-05 at 14:15 -0700, Charlie Jenkins wrote: > Some applications rely on placing data in free bits addresses allocated > by mmap. Various architectures (eg. x86, arm64, powerpc) restrict the > address returned by mmap to be less than the 48-bit address space, > unless the

Re: [PATCH 06/13] mm/memory: Add dax_insert_pfn

2024-09-05 Thread Alistair Popple
Jan Kara writes: > On Thu 27-06-24 10:54:21, Alistair Popple wrote: >> Currently to map a DAX page the DAX driver calls vmf_insert_pfn. This >> creates a special devmap PTE entry for the pfn but does not take a >> reference on the underlying struct page for the mapping. This is >> because DAX p

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-05 Thread Michael Ellerman
Charlie Jenkins writes: > Create a personality flag ADDR_LIMIT_47BIT to support applications > that wish to transition from running in environments that support at > most 47-bit VAs to environments that support larger VAs. This > personality can be set to cause all allocations to be below the 47-b