Skip to content

RFC userfaultfd: non-cooperative: syncronous events

Mike Rapoport linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5userfaultfd: introduce userfault_init_waitqueue helperfs/userfaultfd.c+10 -40 replies
2/5userfaultfd: introduce userfaultfd_should_wait helperfs/userfaultfd.c+16 -60 replies
3/5userfaultfd: non-cooperative: generalize wake key structurefs/userfaultfd.c+57 -390 replies
4/5userfaultfd: non-cooperative: use fault_pending_wqh for all eventsfs/userfaultfd.c+24 -400 replies
5/5userfaultfd: non-cooperative: allow synchronous EVENT_REMOVEfs/userfaultfd.c include/uapi/linux/userfaultfd.h+39 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/5] userfaultfd: non-cooperative: syncronous events

Hi,

These patches add ability to generate userfaultfd events so that thier processing will be synchronized with the non-cooperative thread that caused the event.

In the non-cooperative case userfaultfd resumes execution of the thread that caused an event when the notification is read() by the uffd monitor. In some cases, like, for example, madvise(MADV_REMOVE), it might be desirable to keep the thread that caused the event suspended until the uffd monitor had the event handled.

The first two patches just shuffle the code a bit to make subsequent changes easier.
The patches 3 and 4 create some unification in the way the threads are queued into waitqueues either after page fault or after a non-cooperative event.
The fifth patch extends the userfaultfd API with an implementation of UFFD_EVENT_REMOVE_SYNC that allows to keep the thread that triggered UFFD_EVENT_REMOVE until the uffd monitor would not wake it explicitly.

Mike Rapoport (5):
userfaultfd: introduce userfault_init_waitqueue helper
userfaultfd: introduce userfaultfd_should_wait helper
userfaultfd: non-cooperative: generalize wake key structure
userfaultfd: non-cooperative: use fault_pending_wqh for all events
userfaultfd: non-cooperative: allow synchronous EVENT_REMOVE

 fs/userfaultfd.c                 | 205 ++++++++++++++++++++++++---------------
 include/uapi/linux/userfaultfd.h |  11 +++
 2 files changed, 136 insertions(+), 80 deletions(-)
Signature · 7 lines
2.7.4

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