Skip to content

userfaultfd: non-cooperative: syncronous events

Mike Rapoport linux-api linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3userfaultfd: introduce userfaultfd_init_waitqueue helperfs/userfaultfd.c+10 -40 replies
2/3userfaultfd: non-cooperative: generalize wake key structurefs/userfaultfd.c+72 -420 replies
3/3userfaultfd: non-cooperative: allow synchronous EVENT_REMOVEfs/userfaultfd.c include/uapi/linux/userfaultfd.h+77 -22 replies

Reviews trailers per patch

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

Read the v1 thread

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

Hi,

These patches add ability to generate userfaultfd events so that their 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 to avoid races between the thread that caused the and userfaultfd ioctls.

Theses patches extend 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 (3):
userfaultfd: introduce userfaultfd_init_waitqueue helper
userfaultfd: non-cooperative: generalize wake key structure
userfaultfd: non-cooperative: allow synchronous EVENT_REMOVE

 fs/userfaultfd.c                 | 191 +++++++++++++++++++++++++++++----------
 include/uapi/linux/userfaultfd.h |  14 +++
 2 files changed, 158 insertions(+), 47 deletions(-)
Signature · 1 line
2.7.4