lkml.org 
[lkml]   [2021]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 31/61] drivers/misc/cxl: Use maple tree iterators for cxl_prefault_vma()
    Date
    From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>

    Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
    ---
    drivers/misc/cxl/fault.c | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c
    index 60c829113299..60a33b953ef4 100644
    --- a/drivers/misc/cxl/fault.c
    +++ b/drivers/misc/cxl/fault.c
    @@ -313,6 +313,7 @@ static void cxl_prefault_vma(struct cxl_context *ctx)
    struct vm_area_struct *vma;
    int rc;
    struct mm_struct *mm;
    + MA_STATE(mas, NULL, 0, 0);

    mm = get_mem_context(ctx);
    if (mm == NULL) {
    @@ -321,8 +322,10 @@ static void cxl_prefault_vma(struct cxl_context *ctx)
    return;
    }

    + mas.tree = &mm->mm_mt;
    mmap_read_lock(mm);
    - for (vma = mm->mmap; vma; vma = vma->vm_next) {
    + rcu_read_lock();
    + mas_for_each(&mas, vma, ULONG_MAX) {
    for (ea = vma->vm_start; ea < vma->vm_end;
    ea = next_segment(ea, slb.vsid)) {
    rc = copro_calculate_slb(mm, ea, &slb);
    @@ -336,6 +339,7 @@ static void cxl_prefault_vma(struct cxl_context *ctx)
    last_esid = slb.esid;
    }
    }
    + rcu_read_unlock();
    mmap_read_unlock(mm);

    mmput(mm);
    --
    2.30.2
    \
     
     \ /
      Last update: 2021-08-17 18:10    [W:4.055 / U:0.268 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site