lkml.org 
[lkml]   [2024]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: Remove mm argument from mm_get_unmapped_area()
On Mon, May 06, 2024 at 09:07:47AM -0700, Rick Edgecombe wrote:
> if (flags & MAP_FIXED) {
> /* Ok, don't mess with it. */
> - return mm_get_unmapped_area(current->mm, NULL, orig_addr, len, pgoff, flags);
> + return current_get_unmapped_area(NULL, orig_addr, len, pgoff, flags);

The old name seems preferable because it's not as crazy long. In fact
just get_unmapped_area would be even better, but that's already taken
by something else.

Can we maybe take a step back and sort out the mess of the various
_get_unmapped_area helpers?

e.g. mm_get_unmapped_area_vmflags just wraps
arch_get_unmapped_area_topdown_vmflags and
arch_get_unmapped_area_vmflags, and we might as well merge all three
by moving the MMF_TOPDOWN into two actual implementations?

And then just update all the implementations to always pass the
vm_flags instead of having separate implementations with our without
the flags.

And then make __get_unmapped_area static in mmap.c nad move the
get_unmapped_area wrappers there. And eventually write some
documentation for the functions based on the learnings who actually
uses what..

\
 
 \ /
  Last update: 2024-05-27 18:17    [W:2.524 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site