userfaultfd: non-cooperative: add madvise() event for MADV_FREE request
authorMike Rapoport <[email protected]>
Mon, 10 Jul 2017 22:49:02 +0000 (15:49 -0700)
committerLinus Torvalds <[email protected]>
Mon, 10 Jul 2017 23:32:32 +0000 (16:32 -0700)
commit230ca982ba69ae63294017a3800800ad79d5f003
treefdcf1f80a9dfda7e60c865095db948b5aa234113
parent76b6f9b7edccdfcc7ad1588f24ba01e19db725f3
userfaultfd: non-cooperative: add madvise() event for MADV_FREE request

MADV_FREE is identical to MADV_DONTNEED from the point of view of uffd
monitor.  The monitor has to stop handling #PF events in the range being
freed.  We are reusing userfaultfd_remove callback along with the logic
required to re-get and re-validate the VMA which may change or disappear
because userfaultfd_remove releases mmap_sem.

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