Files
linux/io_uring
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/[email protected]
Signed-off-by: Ryan Roberts <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Reviewed-by: Oscar Salvador <[email protected]>
Reviewed-by: Dev Jain <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Reviewed-by: Lorenzo Stoakes <[email protected]>
Reviewed-by: Baolin Wang <[email protected]>
Cc: Liam Howlett <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2025-11-16 17:27:57 -08:00
..
…
2025-01-28 15:10:40 -07:00
…
…
2025-09-08 08:06:37 -06:00
2025-02-17 16:43:04 -08:00
2025-10-22 10:56:11 -06:00
2025-03-07 13:41:08 -07:00
…
2025-06-23 09:00:12 -06:00
2025-09-19 07:06:43 -06:00
2025-09-08 08:06:37 -06:00
2025-07-16 16:23:28 -06:00
…
…
2024-02-09 09:04:39 -07:00
…
2025-11-03 08:55:58 -07:00
2025-11-03 08:55:58 -07:00