userfaultfd: non-cooperative: add madvise() event for MADV_REMOVE request
authorMike Rapoport <[email protected]>
Fri, 24 Feb 2017 22:56:05 +0000 (14:56 -0800)
committerLinus Torvalds <[email protected]>
Sat, 25 Feb 2017 01:46:54 +0000 (17:46 -0800)
commita6bf53eba98e0c36f51322cd6aa771c0ffa283f3
treec1ccbe8b6c2c89d84c1e4b5d3025209e19b89570
parentd811914d87576c562e849c00d9f9beff45038801
userfaultfd: non-cooperative: add madvise() event for MADV_REMOVE request

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.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Mike Rapoport <[email protected]>
Reviewed-by: Andrea Arcangeli <[email protected]>
Acked-by: Hillf Danton <[email protected]>
Acked-by: Pavel Emelyanov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/madvise.c