]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/userfaultfd.2
fuse.4: ffix
[thirdparty/man-pages.git] / man2 / userfaultfd.2
index 1741ee3adc0b287a9630d8f23cde7069196c15ab..e1a8343b3b36272fdd94334dad935f528ea3e5b1 100644 (file)
@@ -168,10 +168,36 @@ the user-space application.
 The application can then use the
 .B UFFDIO_COPY
 or
-.B UFFDIO_ZERO
+.B UFFDIO_ZEROPAGE
 .BR ioctl (2)
 operations to resolve the page fault.
 .PP
+Starting from Linux 4.14, if the application sets the
+.B UFFD_FEATURE_SIGBUS
+feature bit using the
+.B UFFDIO_API
+.BR ioctl (2),
+no page-fault notification will be forwarded to user space.
+Instead a
+.B SIGBUS
+signal is delivered to the faulting process.
+With this feature,
+userfaultfd can be used for robustness purposes to simply catch
+any access to areas within the registered address range that do not
+have pages allocated, without having to listen to userfaultfd events.
+No userfaultfd monitor will be required for dealing with such memory
+accesses.
+For example, this feature can be useful for applications that
+want to prevent the kernel from automatically allocating pages and filling
+holes in sparse files when the hole is accessed through a memory mapping.
+.PP
+The
+.B UFFD_FEATURE_SIGBUS
+feature is implicitly inherited through
+.BR fork (2)
+if used in combination with
+.BR UFFD_FEATURE_FORK .
+.PP
 Details of the various
 .BR ioctl (2)
 operations can be found in
@@ -439,6 +465,16 @@ for checkpoint/restore mechanisms,
 as well as post-copy migration to allow (nearly) uninterrupted execution
 when transferring virtual machines and Linux containers
 from one host to another.
+.SH BUGS
+If the
+.B UFFD_FEATURE_EVENT_FORK
+is enabled and a system call from the
+.BR fork (2)
+family is interrupted by a signal or failed, a stale userfaultfd descriptor
+might be created.
+In this case, a spurious
+.B UFFD_EVENT_FORK
+will be delivered to the userfaultfd monitor.
 .SH EXAMPLE
 The program below demonstrates the use of the userfaultfd mechanism.
 The program creates two threads, one of which acts as the
@@ -720,6 +756,6 @@ main(int argc, char *argv[])
 .BR madvise (2),
 .BR mmap (2)
 .PP
-.IR Documentation/vm/userfaultfd.txt
+.IR Documentation/admin-guide/mm/userfaultfd.rst
 in the Linux kernel source tree
 .PP