• Michel Lespinasse's avatar
    mm: vm_unmapped_area() lookup function · db4fbfb9
    Michel Lespinasse authored
    Implement vm_unmapped_area() using the rb_subtree_gap and highest_vm_end
    information to look up for suitable virtual address space gaps.
    
    struct vm_unmapped_area_info is used to define the desired allocation
    request:
     - lowest or highest possible address matching the remaining constraints
     - desired gap length
     - low/high address limits that the gap must fit into
     - alignment mask and offset
    
    Also update the generic arch_get_unmapped_area[_topdown] functions to make
    use of vm_unmapped_area() instead of implementing a brute force search.
    
    [akpm@linux-foundation.org: checkpatch fixes]
    Signed-off-by: default avatarMichel Lespinasse <walken@google.com>
    Reviewed-by: default avatarRik van Riel <riel@redhat.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Russell King <linux@arm.linux.org.uk>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: Paul Mundt <lethal@linux-sh.org>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Chris Metcalf <cmetcalf@tilera.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    db4fbfb9
mmap.c 78.9 KB