Re: [PATCH mm-unstable v2 00/16] mm: Introduce arch_mmap_hint()

2024-12-13 Thread Kalesh Singh
On Fri, Dec 13, 2024 at 11:45 AM 'Liam R. Howlett' via kernel-team wrote: > > * Lorenzo Stoakes [241213 10:16]: > > On Fri, Dec 13, 2024 at 10:06:55AM -0500, Kalesh Singh wrote: > > > On Fri, Dec 13, 2024 at 4:00 AM Lorenzo Stoakes > > > wrote: > >

Re: [PATCH mm-unstable v2 00/16] mm: Introduce arch_mmap_hint()

2024-12-13 Thread Kalesh Singh
On Fri, Dec 13, 2024 at 4:00 AM Lorenzo Stoakes wrote: > > On Thu, Dec 12, 2024 at 05:36:09PM -0800, Andrew Morton wrote: > > On Thu, 12 Dec 2024 22:51:34 + Lorenzo Stoakes > > wrote: > > > > > You've fundamentally violated kernel process and etiquette. I'd be more > > > forgiving, but this

[PATCH mm-unstable v2 16/16] mm: Respect mmap hint before THP alignment if allocation is possible

2024-12-11 Thread Kalesh Singh
ion was successful at the hint address or not. Instead, use arch_mmap_hint() to first attempt allocation at the hint address and fallback to THP alignment if there isn't sufficient VA space to satisfy the allocation at the hint address. Signed-off-by: Kalesh Singh --- mm/huge_memory.c | 1

[PATCH mm-unstable v2 00/16] mm: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
he hint address. Patches 1-16 introduce this new helper and Patch 17 uses it to fix the issue of mmap hint being ignored in some cases due to THP alignment [1] [1] https://lore.kernel.org/r/20241118214650.3667577-1-kaleshsi...@google.com/ Thanks, Kalesh Kalesh Singh (16): mm: Introduce generic_mm

[PATCH mm-unstable v2 08/16] mm: mips: Introduce arch_align_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce mips arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is also handled in arch_mmap_hint() since this is just a special case of the hint addr being

[PATCH mm-unstable v2 07/16] mm: loongarch: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce loongarch arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is also handled in arch_mmap_hint() since this is just a special case of the hint addr

[PATCH mm-unstable v2 14/16] mm: xtensa: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce xtensa arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. If a sufficiently sized hole doesn't exist at the hint address, fallback to searching the entire valid VA space instead of only the VA space above the hint address. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_

[PATCH mm-unstable v2 13/16] mm: sparc64: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce sparc64 arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is also handled in arch_mmap_hint() since this is just a special case of the hint addr being

[PATCH mm-unstable v2 15/16] mm: powerpc: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce powerpc arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/powerpc/include/asm/book3s/64/slice.h | 1 + arch/powerpc/mm/book3s64/slice.c | 31 ++ 2 files

[PATCH mm-unstable v2 11/16] mm: sh: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce sh arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is also handled in arch_mmap_hint() since this is just a special case of the hint addr being

[PATCH mm-unstable v2 06/16] mm: csky: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce csky arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is also handled in arch_mmap_hint() since this is just a special case of the hint addr being

[PATCH mm-unstable v2 05/16] mm: arc: Use generic_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce arc arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is also handled in arch_mmap_hint() since this is just a special case of the hint addr being

[PATCH mm-unstable v2 09/16] mm: parisc: Introduce arch_align_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce parisc arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is also handled in arch_mmap_hint() since this is just a special case of the hint addr being

[PATCH mm-unstable v2 04/16] mm: alpha: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce alpha arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - Consolidate error handling in arch_mmap_hint(). arch/alpha/include/asm/pgtable.h | 1 + arch/alpha/kernel

[PATCH mm-unstable v2 12/16] mm: sparc32: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce sparc32 arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. If a sufficiently sized hole doesn't exist at the hint address, fallback to searching the entire valid VA space instead of only the VA space above the hint address. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_

[PATCH mm-unstable v2 10/16] mm: s390: Use generic_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce s390 arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is also handled in arch_mmap_hint() since this is just a special case of the hint addr being

[PATCH mm-unstable v2 02/16] mm: x86: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce x86 arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Fallback to generic_mmap_hint() if an architecture doesn't provide HAVE_ARCH_MMAP_HINT. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is

[PATCH mm-unstable v2 01/16] mm: Introduce generic_mmap_hint()

2024-12-11 Thread Kalesh Singh
Consolidate the hint searches from both directions (topdown and bottomup) into generic_mmap_hint(). No functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is also handled in arch_mmap_hint() since this is just a special case of the hint addr

[PATCH mm-unstable v2 03/16] mm: arm: Introduce arch_mmap_hint()

2024-12-11 Thread Kalesh Singh
Introduce arm arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- Changes in v2: - MAP_FIXED case is also handled in arch_mmap_hint() since this is just a special case of the hint addr being

Re: [PATCH mm-unstable 01/17] mm: Introduce generic_mmap_hint()

2024-12-10 Thread Kalesh Singh
On Mon, Dec 9, 2024 at 7:27 PM Yang Shi wrote: > > On Mon, Dec 9, 2024 at 6:41 PM Kalesh Singh wrote: > > > > Consolidate the hint searches from both direcitons (topdown and > > bottomup) into generic_mmap_hint(). > > > > No functional change is introduced.

Re: [PATCH mm-unstable 17/17] mm: Respect mmap hint before THP alignment if allocation is possible

2024-12-10 Thread Kalesh Singh
On Mon, Dec 9, 2024 at 7:37 PM Yang Shi wrote: > > On Mon, Dec 9, 2024 at 6:45 PM Kalesh Singh wrote: > > > > Commit 249608ee4713 ("mm: respect mmap hint address when aligning for THP") > > fallsback to PAGE_SIZE alignment instead of THP alignment > >

[PATCH mm-unstable 17/17] mm: Respect mmap hint before THP alignment if allocation is possible

2024-12-09 Thread Kalesh Singh
ion was successful at the hint address or not. Instead, use arch_mmap_hint() to first attempt allocation at the hint address and fallback to THP alignment if that fails. Signed-off-by: Kalesh Singh --- mm/huge_memory.c | 15 --- mm/mmap.c| 1 - 2 files changed, 8 insertions

[PATCH mm-unstable 16/17] mm: Fallback to generic_mmap_hint()

2024-12-09 Thread Kalesh Singh
If an architecture doesn't provide arch_mmap_hint() fallback to generic_mmap_hint(). Signed-off-by: Kalesh Singh --- mm/mmap.c | 9 + 1 file changed, 9 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index e97eb8bf4889..59bf7d127aa1 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -

[PATCH mm-unstable 15/17] mm: powerpc: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce powerpc arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/powerpc/include/asm/book3s/64/slice.h | 1 + arch/powerpc/mm/book3s64/slice.c | 31 ++ 2 files

[PATCH mm-unstable 14/17] mm: xtensa: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce xtensa arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. If a sufficiently sized hole doesn't exist at the hint address, fallback to searching the entire valid VA space instead of only the VA space above the hint address. Signed-off-by: Kalesh Singh --- arch/xtensa/includ

[PATCH mm-unstable 13/17] mm: sparc64: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce sparc64 arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/sparc/include/asm/pgtable_64.h | 1 + arch/sparc/kernel/sys_sparc_64.c| 47 + 2 files changed

[PATCH mm-unstable 11/17] mm: sh: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce sh arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/sh/include/asm/pgtable.h | 1 + arch/sh/mm/mmap.c | 48 +++ 2 files changed, 27

[PATCH mm-unstable 12/17] mm: sparc32: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce sparc32 arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. If a sufficiently sized hole doesn't exist at the hint address, fallback to searching the entire valid VA space instead of only the VA space above the hint address. Signed-off-by: Kalesh Singh --- arch/sparc/includ

[PATCH mm-unstable 10/17] mm: s390: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce s390 arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/s390/include/asm/pgtable.h | 1 + arch/s390/mm/mmap.c | 32 2 files changed, 17

[PATCH mm-unstable 09/17] mm: parisc: Introduce arch_align_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce parisc arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/parisc/include/asm/pgtable.h | 1 + arch/parisc/kernel/sys_parisc.c | 37 --- 2 files changed

[PATCH mm-unstable 08/17] mm: mips: Introduce arch_align_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce mips arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/mips/include/asm/pgtable.h | 1 + arch/mips/mm/mmap.c | 39 + 2 files changed, 26

[PATCH mm-unstable 07/17] mm: loongarch: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce loongarch arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/loongarch/include/asm/pgtable.h | 1 + arch/loongarch/mm/mmap.c | 40 ++-- 2 files

[PATCH mm-unstable 06/17] mm: csky: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce csky arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/csky/abiv1/inc/abi/pgtable-bits.h | 1 + arch/csky/abiv1/mmap.c | 38 ++ 2 files changed

[PATCH mm-unstable 04/17] mm: alpha: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce alpha arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/alpha/include/asm/pgtable.h | 1 + arch/alpha/kernel/osf_sys.c | 29 - 2 files changed, 25

[PATCH mm-unstable 05/17] mm: arc: Use generic_mmap_hint()

2024-12-09 Thread Kalesh Singh
Use generic_mmap_hint() in arch arch_get_unmapped_area(). Signed-off-by: Kalesh Singh --- arch/arc/mm/mmap.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arc/mm/mmap.c b/arch/arc/mm/mmap.c index 2185afe8d59f..6b1fcea06779 100644 --- a/arch/arc/mm/mmap.c

[PATCH mm-unstable 03/17] mm: arm: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce arm arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/arm/include/asm/pgtable.h | 1 + arch/arm/mm/mmap.c | 54 +++--- 2 files changed, 32

[PATCH mm-unstable 02/17] mm: x86: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
Introduce x86 arch_mmap_hint() and define HAVE_ARCH_MMAP_HINT. This is a preparatory patch, no functional change is introduced. Signed-off-by: Kalesh Singh --- arch/x86/include/asm/pgtable_64.h | 1 + arch/x86/kernel/sys_x86_64.c | 49 ++- include/linux/sched

[PATCH mm-unstable 00/17] mm: Introduce arch_mmap_hint()

2024-12-09 Thread Kalesh Singh
/20241118214650.3667577-1-kaleshsi...@google.com/ Thanks, Kalesh Kalesh Singh (17): mm: Introduce generic_mmap_hint() mm: x86: Introduce arch_mmap_hint() mm: arm: Introduce arch_mmap_hint() mm: alpha: Introduce arch_mmap_hint() mm: arc: Use generic_mmap_hint() mm: csky: Introduce arch_mmap_hint() mm

[PATCH mm-unstable 01/17] mm: Introduce generic_mmap_hint()

2024-12-09 Thread Kalesh Singh
Consolidate the hint searches from both direcitons (topdown and bottomup) into generic_mmap_hint(). No functional change is introduced. Signed-off-by: Kalesh Singh --- include/linux/sched/mm.h | 4 mm/mmap.c| 45 2 files changed