Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1633804
| From | "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH man-pages 1/2] userfaultfd.2: start documenting non-cooperative events |
| Date | 2017-05-01 20:40 +0200 |
| Message-ID | <tCooO-4aC-23@gated-at.bofh.it> (permalink) |
| References | <tASqZ-1Iz-3@gated-at.bofh.it> <tASr0-1Iz-11@gated-at.bofh.it> <tAVoR-3H8-13@gated-at.bofh.it> <tBaHg-5yJ-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Mike, On 04/28/2017 11:45 AM, Mike Rapoprt wrote: > > > On April 27, 2017 8:26:16 PM GMT+03:00, "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> wrote: >> Hi Mike, >> >> I've applied this, but have some questions/points I think >> further clarification. >> >> On 04/27/2017 04:14 PM, Mike Rapoport wrote: >>> Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> >>> --- >>> man2/userfaultfd.2 | 135 >> ++++++++++++++++++++++++++++++++++++++++++++++++++--- >>> 1 file changed, 128 insertions(+), 7 deletions(-) >>> >>> diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2 >>> index cfea5cb..44af3e4 100644 >>> --- a/man2/userfaultfd.2 >>> +++ b/man2/userfaultfd.2 >>> @@ -75,7 +75,7 @@ flag in >>> .PP >>> When the last file descriptor referring to a userfaultfd object is >> closed, >>> all memory ranges that were registered with the object are >> unregistered >>> -and unread page-fault events are flushed. >>> +and unread events are flushed. >>> .\" >>> .SS Usage >>> The userfaultfd mechanism is designed to allow a thread in a >> multithreaded >>> @@ -99,6 +99,20 @@ In such non-cooperative mode, >>> the process that monitors userfaultfd and handles page faults >>> needs to be aware of the changes in the virtual memory layout >>> of the faulting process to avoid memory corruption. >>> + >>> +Starting from Linux 4.11, >>> +userfaultfd may notify the fault-handling threads about changes >>> +in the virtual memory layout of the faulting process. >>> +In addition, if the faulting process invokes >>> +.BR fork (2) >>> +system call, >>> +the userfaultfd objects associated with the parent may be duplicated >>> +into the child process and the userfaultfd monitor will be notified >>> +about the file descriptor associated with the userfault objects >> >> What does "notified about the file descriptor" mean? > > Well, seems that I've made this one really awkward :) > When the monitored process forks, all the userfault objects > associated​ with it are duplicated into the child process. For each > duplicated object, userfault generates event of type UFFD_EVENT_FORK > and the uffdio_msg for this event contains the file descriptor that > should be used to manipulate the duplicated userfault object. > Hope this clarifies. Yes, it's clearer now. Mostly what was needed here was a forward reference that mentions UFFD_EVENT_FORK explicitly. I added that, and also enhanced the text on UFFD_EVENT_FORK a little. Also, it's not just fork(2) for which UFFD_EVENT_FORK is generated, right? It can also be a clone(2) cal that does not specify CLONE_VM, right? Could you review my changes in commit 522ab2ff6fc9010432a to make sure they are okay. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH man-pages 1/2] userfaultfd.2: start documenting non-cooperative events Mike Rapoport <rppt@linux.vnet.ibm.com> - 2017-04-27 16:20 +0200
Re: [PATCH man-pages 1/2] userfaultfd.2: start documenting non-cooperative events "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-04-27 19:30 +0200
Re: [PATCH man-pages 1/2] userfaultfd.2: start documenting non-cooperative events Mike Rapoprt <rppt@linux.vnet.ibm.com> - 2017-04-28 11:50 +0200
Re: [PATCH man-pages 1/2] userfaultfd.2: start documenting non-cooperative events "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-05-01 20:40 +0200
Re: [PATCH man-pages 1/2] userfaultfd.2: start documenting non-cooperative events Mike Rapoport <rppt@linux.vnet.ibm.com> - 2017-05-02 11:30 +0200
Re: [PATCH man-pages 1/2] userfaultfd.2: start documenting non-cooperative events "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-05-02 22:30 +0200
csiph-web