Go to file
Ryan Roberts 9ac09bb9fe mm: consistently use current->mm in mm_get_unmapped_area()
mm_get_unmapped_area() is a wrapper around arch_get_unmapped_area() /
arch_get_unmapped_area_topdown(), both of which search current->mm for
some free space.  Neither take an mm_struct - they implicitly operate on
current->mm.

But the wrapper takes an mm_struct and uses it to decide whether to search
bottom up or top down.  All callers pass in current->mm for this, so
everything is working consistently.  But it feels like an accident waiting
to happen; eventually someone will call that function with a different mm,
expecting to find free space in it, but what gets returned is free space
in the current mm.

So let's simplify by removing the parameter and have the wrapper use
current->mm to decide which end to start at.  Now everything is consistent
and self-documenting.

Link: https://lkml.kernel.org/r/20251003155306.2147572-1-ryan.roberts@arm.com
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-11-16 17:27:57 -08:00
Documentation Docs/admin-guide/mm/zswap: s/red-black tree/xarray/ 2025-11-16 17:27:57 -08:00
LICENSES
arch mm: consistently use current->mm in mm_get_unmapped_area() 2025-11-16 17:27:57 -08:00
block block-6.18-20251031 2025-10-31 12:57:19 -07:00
certs
crypto
drivers mm: consistently use current->mm in mm_get_unmapped_area() 2025-11-16 17:27:57 -08:00
fs mm: consistently use current->mm in mm_get_unmapped_area() 2025-11-16 17:27:57 -08:00
include mm: consistently use current->mm in mm_get_unmapped_area() 2025-11-16 17:27:57 -08:00
init
io_uring mm: consistently use current->mm in mm_get_unmapped_area() 2025-11-16 17:27:57 -08:00
ipc
kernel mm: consistently use current->mm in mm_get_unmapped_area() 2025-11-16 17:27:57 -08:00
lib lib/test_vmalloc: remove xfail condition check 2025-11-16 17:27:53 -08:00
mm mm: consistently use current->mm in mm_get_unmapped_area() 2025-11-16 17:27:57 -08:00
net Including fixes from bluetooth and wireless. 2025-11-06 08:52:30 -08:00
rust rust: kbuild: workaround `rustdoc` doctests modifier bug 2025-11-04 00:00:06 +01:00
samples
scripts scripts/decode_stacktrace.sh: fix build ID and PC source parsing 2025-11-09 21:19:45 -08:00
security
sound ASoC: Fixes for v6.18 2025-10-30 13:08:08 +01:00
tools selftests: update ksm inheritance tests for prctl fork/exec 2025-11-16 17:27:55 -08:00
usr
virt KVM x86 fixes for 6.18: 2025-10-18 10:25:43 +02:00
.clang-format
.clippy.toml
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap MAINTAINERS: update David Hildenbrand's email address 2025-11-15 10:52:01 -08:00
.pylintrc
.rustfmt.toml
COPYING
CREDITS MAINTAINERS: mark ISDN subsystem as orphan 2025-10-27 17:49:45 -07:00
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: update David Hildenbrand's email address 2025-11-15 10:52:01 -08:00
Makefile Linux 6.18-rc5 2025-11-09 15:10:19 -08:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.