lkml.org 
[lkml]   [2018]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC v8 PATCH 3/5] mm: mmap: zap pages with read mmap_sem in munmap
From
Date


On 8/22/18 4:11 AM, Vlastimil Babka wrote:
> On 08/15/2018 08:49 PM, Yang Shi wrote:
>
>> + start_vma = munmap_lookup_vma(mm, start, end);
>> + if (!start_vma)
>> + goto out;
>> + if (IS_ERR(start_vma)) {
>> + ret = PTR_ERR(start_vma);
>> + goto out;
>> + }
>> +
>> + prev = start_vma->vm_prev;
>> +
>> + if (unlikely(uf)) {
>> + ret = userfaultfd_unmap_prep(start_vma, start, end, uf);
>> + if (ret)
>> + goto out;
>> + }
>> +
> You sure it's ok to redo this in case of goto regular path? The
> preparations have some side-effects... I would rather move this after
> the regular path check?

This preparation sets vma->vm_userfaultfd_ctx.ctx for each vmas. But,
before doing this, it calls has_unmap_ctx() to check if the ctx has been
set or not. If it has been set, it just skip the vma. It sounds ok, right?


\
 
 \ /
  Last update: 2018-08-22 21:21    [W:0.071 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site