linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Hillf Danton" <hillf.zj@alibaba-inc.com>
To: 'Mike Rapoport' <rppt@linux.vnet.ibm.com>,
	'Andrew Morton' <akpm@linux-foundation.org>
Cc: 'Andrea Arcangeli' <aarcange@redhat.com>,
	"'Dr. David Alan Gilbert'" <dgilbert@redhat.com>,
	'Mike Kravetz' <mike.kravetz@oracle.com>,
	'Pavel Emelyanov' <xemul@virtuozzo.com>,
	linux-mm@kvack.org
Subject: Re: [PATCH 2/3] userfaultfd: non-cooperative: add madvise() event for MADV_REMOVE request
Date: Thu, 19 Jan 2017 16:58:14 +0800	[thread overview]
Message-ID: <03ae01d27232$2b590030$820b0090$@alibaba-inc.com> (raw)
In-Reply-To: <1484814154-1557-3-git-send-email-rppt@linux.vnet.ibm.com>


On Thursday, January 19, 2017 4:23 PM Mike Rapoport wrote: 
> 
> When a page is removed from a shared mapping, the uffd reader should be
> notified, so that it won't attempt to handle #PF events for the removed
> pages.
> We can reuse the UFFD_EVENT_REMOVE because from the uffd monitor point
> of view, the semantices of madvise(MADV_DONTNEED) and madvise(MADV_REMOVE)
> is exactly the same.
> 
> Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> ---
Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>

>  mm/madvise.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/madvise.c b/mm/madvise.c
> index ab5ef14..0012071 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -520,6 +520,7 @@ static long madvise_remove(struct vm_area_struct *vma,
>  	 * mmap_sem.
>  	 */
>  	get_file(f);
> +	userfaultfd_remove(vma, prev, start, end);
>  	up_read(&current->mm->mmap_sem);
>  	error = vfs_fallocate(f,
>  				FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> --
> 1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-01-19  8:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19  8:22 [PATCH 0/3] " Mike Rapoport
2017-01-19  8:22 ` [PATCH 1/3] userfaultfd: non-cooperative: rename *EVENT_MADVDONTNEED to *EVENT_REMOVE Mike Rapoport
2017-01-19  8:43   ` Hillf Danton
2017-01-19  8:22 ` [PATCH 2/3] userfaultfd: non-cooperative: add madvise() event for MADV_REMOVE request Mike Rapoport
2017-01-19  8:58   ` Hillf Danton [this message]
2017-01-19  8:22 ` [PATCH 3/3] userfaultfd: non-cooperative: selftest: enable REMOVE event test for shmem Mike Rapoport
2017-01-19 18:15 ` [PATCH 0/3] userfaultfd: non-cooperative: add madvise() event for MADV_REMOVE request Andrea Arcangeli
2017-01-23 12:36 ` Pavel Emelyanov

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='03ae01d27232$2b590030$820b0090$@alibaba-inc.com' \
    --to=hillf.zj@alibaba-inc.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dgilbert@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=rppt@linux.vnet.ibm.com \
    --cc=xemul@virtuozzo.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox