[no subject]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I don't see how you're going to actually enforce this in a process either
via an mmap flag, as a library might decide not to use it, so you'd need to
control the allocator, the thread library implementation, and everything
that might allocate.

Liam also raised various points about VMA particulars that I'm not sure are
addressed either.

I just find it hard to believe that everything will fit together.

I'd _really_ need to be convinced that this MAP_ flag is justified, and I"m
just not.

>
> This flag will also allow seemless compatibility between all
> architectures, so applications like Go and OpenJDK that use bits in a
> virtual address can request the exact number of bits they need in a
> generic way. The flag can be checked inside of vm_unmapped_area() so
> that this flag does not have to be handled individually by each
> architecture.

I'm still very unconvinced and feel the bar needs to be high for making
changes like this that carry maintainership burden.

So for me, it's a no really as an overall concept.

Happy to be convinced otherwise, however... (I may be missing details or
context that provide more justification).

>
> Link:
> https://github.com/openjdk/jdk/blob/f080b4bb8a75284db1b6037f8c00ef3b1ef1add1/src/hotspot/cpu/riscv/vm_version_riscv.cpp#L79
> [1]
> Link:
> https://github.com/golang/go/blob/9e8ea567c838574a0f14538c0bbbd83c3215aa55/src/runtime/tagptr_64bit.go#L47
> [2]
>
> To: Arnd Bergmann <arnd@xxxxxxxx>
> To: Richard Henderson <richard.henderson@xxxxxxxxxx>
> To: Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>
> To: Matt Turner <mattst88@xxxxxxxxx>
> To: Vineet Gupta <vgupta@xxxxxxxxxx>
> To: Russell King <linux@xxxxxxxxxxxxxxx>
> To: Guo Ren <guoren@xxxxxxxxxx>
> To: Huacai Chen <chenhuacai@xxxxxxxxxx>
> To: WANG Xuerui <kernel@xxxxxxxxxx>
> To: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>
> To: James E.J. Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>
> To: Helge Deller <deller@xxxxxx>
> To: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
> To: Nicholas Piggin <npiggin@xxxxxxxxx>
> To: Christophe Leroy <christophe.leroy@xxxxxxxxxx>
> To: Naveen N Rao <naveen@xxxxxxxxxx>
> To: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>
> To: Gerald Schaefer <gerald.schaefer@xxxxxxxxxxxxx>
> To: Heiko Carstens <hca@xxxxxxxxxxxxx>
> To: Vasily Gorbik <gor@xxxxxxxxxxxxx>
> To: Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>
> To: Sven Schnelle <svens@xxxxxxxxxxxxx>
> To: Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>
> To: Rich Felker <dalias@xxxxxxxx>
> To: John Paul Adrian Glaubitz <glaubitz@xxxxxxxxxxxxxxxxxxx>
> To: David S. Miller <davem@xxxxxxxxxxxxx>
> To: Andreas Larsson <andreas@xxxxxxxxxxx>
> To: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> To: Ingo Molnar <mingo@xxxxxxxxxx>
> To: Borislav Petkov <bp@xxxxxxxxx>
> To: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> To: x86@xxxxxxxxxx
> To: H. Peter Anvin <hpa@xxxxxxxxx>
> To: Andy Lutomirski <luto@xxxxxxxxxx>
> To: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> To: Muchun Song <muchun.song@xxxxxxxxx>
> To: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> To: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
> To: Vlastimil Babka <vbabka@xxxxxxx>
> To: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
> To: Shuah Khan <shuah@xxxxxxxxxx>
> Cc: linux-arch@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: linux-alpha@xxxxxxxxxxxxxxx
> Cc: linux-snps-arc@xxxxxxxxxxxxxxxxxxx
> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> Cc: linux-csky@xxxxxxxxxxxxxxx
> Cc: loongarch@xxxxxxxxxxxxxxx
> Cc: linux-mips@xxxxxxxxxxxxxxx
> Cc: linux-parisc@xxxxxxxxxxxxxxx
> Cc: linuxppc-dev@xxxxxxxxxxxxxxxx
> Cc: linux-s390@xxxxxxxxxxxxxxx
> Cc: linux-sh@xxxxxxxxxxxxxxx
> Cc: sparclinux@xxxxxxxxxxxxxxx
> Cc: linux-mm@xxxxxxxxx
> Cc: linux-kselftest@xxxxxxxxxxxxxxx
> Signed-off-by: Charlie Jenkins <charlie@xxxxxxxxxxxx>
>
> Changes in v2:
> - Added much greater detail to cover letter
> - Removed all code that touched architecture specific code and was able
>   to factor this out into all generic functions, except for flags that
>   needed to be added to vm_unmapped_area_info
> - Made this an RFC since I have only tested it on riscv and x86
> - Link to v1: https://lore.kernel.org/r/20240827-patches-below_hint_mmap-v1-0-46ff2eb9022d@xxxxxxxxxxxx
>
> ---
> Charlie Jenkins (4):
>       mm: Add MAP_BELOW_HINT
>       mm: Add hint and mmap_flags to struct vm_unmapped_area_info
>       mm: Support MAP_BELOW_HINT in vm_unmapped_area()
>       selftests/mm: Create MAP_BELOW_HINT test
>
>  arch/alpha/kernel/osf_sys.c                  |  2 ++
>  arch/arc/mm/mmap.c                           |  3 +++
>  arch/arm/mm/mmap.c                           |  7 ++++++
>  arch/csky/abiv1/mmap.c                       |  3 +++
>  arch/loongarch/mm/mmap.c                     |  3 +++
>  arch/mips/mm/mmap.c                          |  3 +++
>  arch/parisc/kernel/sys_parisc.c              |  3 +++
>  arch/powerpc/mm/book3s64/slice.c             |  7 ++++++
>  arch/s390/mm/hugetlbpage.c                   |  4 ++++
>  arch/s390/mm/mmap.c                          |  6 ++++++
>  arch/sh/mm/mmap.c                            |  6 ++++++
>  arch/sparc/kernel/sys_sparc_32.c             |  3 +++
>  arch/sparc/kernel/sys_sparc_64.c             |  6 ++++++
>  arch/sparc/mm/hugetlbpage.c                  |  4 ++++
>  arch/x86/kernel/sys_x86_64.c                 |  6 ++++++
>  arch/x86/mm/hugetlbpage.c                    |  4 ++++
>  fs/hugetlbfs/inode.c                         |  4 ++++
>  include/linux/mm.h                           |  2 ++
>  include/uapi/asm-generic/mman-common.h       |  1 +
>  mm/mmap.c                                    |  9 ++++++++
>  tools/include/uapi/asm-generic/mman-common.h |  1 +
>  tools/testing/selftests/mm/Makefile          |  1 +
>  tools/testing/selftests/mm/map_below_hint.c  | 32 ++++++++++++++++++++++++++++
>  23 files changed, 120 insertions(+)
> ---
> base-commit: 5be63fc19fcaa4c236b307420483578a56986a37
> change-id: 20240827-patches-below_hint_mmap-b13d79ae1c55
> --
> - Charlie
>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux