All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Shi <yang.shi@linux.alibaba.com>
To: Vlastimil Babka <vbabka@suse.cz>,
	mhocko@kernel.org, willy@infradead.org,
	ldufour@linux.vnet.ibm.com, kirill@shutemov.name,
	akpm@linux-foundation.org, peterz@infradead.org,
	mingo@redhat.com, acme@kernel.org,
	alexander.shishkin@linux.intel.com, jolsa@redhat.com,
	namhyung@kernel.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC v8 PATCH 3/5] mm: mmap: zap pages with read mmap_sem in munmap
Date: Wed, 22 Aug 2018 12:20:37 -0700	[thread overview]
Message-ID: <2f447d4e-9e16-8030-85f0-4e258a7eafa3@linux.alibaba.com> (raw)
In-Reply-To: <7145895b-ef56-f5ee-d139-609819d9a107@suse.cz>



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?



  reply	other threads:[~2018-08-22 19:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-15 18:49 [RFC v8 PATCH 0/5] mm: zap pages with read mmap_sem in munmap for large mapping Yang Shi
2018-08-15 18:49 ` [RFC v8 PATCH 1/5] mm: refactor do_munmap() to extract the common part Yang Shi
2018-08-15 18:49 ` [RFC v8 PATCH 2/5] uprobes: introduce has_uprobes helper Yang Shi
2018-08-22 10:55   ` Vlastimil Babka
2018-08-22 15:07     ` Srikar Dronamraju
2018-08-22 20:51       ` Yang Shi
2018-08-23 15:15       ` Oleg Nesterov
2018-08-23 16:07         ` Yang Shi
2018-08-15 18:49 ` [RFC v8 PATCH 3/5] mm: mmap: zap pages with read mmap_sem in munmap Yang Shi
2018-08-15 19:16   ` Matthew Wilcox
2018-08-15 21:09     ` Matthew Wilcox
2018-08-15 21:54       ` Yang Shi
2018-08-16  2:46         ` Matthew Wilcox
2018-08-16  6:11           ` Yang Shi
2018-08-22 11:11   ` Vlastimil Babka
2018-08-22 19:20     ` Yang Shi [this message]
2018-08-22 11:19   ` Vlastimil Babka
2018-08-22 20:45     ` Yang Shi
2018-08-22 21:10       ` Kirill A. Shutemov
2018-08-22 21:42         ` Dave Hansen
2018-08-22 21:56           ` Yang Shi
2018-08-22 22:03             ` Dave Hansen
2018-08-22 22:03               ` Dave Hansen
2018-08-15 18:49 ` [RFC v8 PATCH 4/5] mm: unmap VM_HUGETLB mappings with optimized path Yang Shi
2018-08-15 18:49 ` [RFC v8 PATCH 5/5] mm: unmap VM_PFNMAP " Yang Shi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f447d4e-9e16-8030-85f0-4e258a7eafa3@linux.alibaba.com \
    --to=yang.shi@linux.alibaba.com \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=kirill@shutemov.name \
    --cc=ldufour@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.