lkml.org 
[lkml]   [2022]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v5 52/70] mm/gup: Use maple tree navigation instead of linked list
    Date
    From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>

    Use find_vma_intersection() to locate the VMAs in __mm_populate()
    instead of using find_vma() and the linked list.

    Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
    ---
    mm/gup.c | 7 ++++---
    1 file changed, 4 insertions(+), 3 deletions(-)

    diff --git a/mm/gup.c b/mm/gup.c
    index f0af462ac1e2..0fef70bc6736 100644
    --- a/mm/gup.c
    +++ b/mm/gup.c
    @@ -1584,10 +1584,11 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
    if (!locked) {
    locked = 1;
    mmap_read_lock(mm);
    - vma = find_vma(mm, nstart);
    + vma = find_vma_intersection(mm, nstart, end);
    } else if (nstart >= vma->vm_end)
    - vma = vma->vm_next;
    - if (!vma || vma->vm_start >= end)
    + vma = find_vma_intersection(mm, vma->vm_end, end);
    +
    + if (!vma)
    break;
    /*
    * Set [nstart; nend) to intersection of desired address
    --
    2.34.1
    \
     
     \ /
      Last update: 2022-02-02 03:45    [W:3.659 / U:0.176 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site