* [PATCH v2] Userfaultfd: Add description for UFFD_FEATURE_SIGBUS
@ 2017-10-09 22:45 Prakash Sangappa
2017-10-09 22:54 ` Andrea Arcangeli
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Prakash Sangappa @ 2017-10-09 22:45 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
aarcange-H+wXaHxf7aLQT0dZR+AlfA,
rppt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8, mhocko-IBi9RG/b67k,
prakash.sangappa-QHcLZuEGTsvQT0dZR+AlfA
Userfaultfd feature UFFD_FEATURE_SIGBUS was merged recently and should
be available in Linux 4.14 release. This patch is for the manpage
changes documenting this API.
Documents the following commit:
commit 2d6d6f5a09a96cc1fec7ed992b825e05f64cb50e
Author: Prakash Sangappa <prakash.sangappa-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Date: Wed Sep 6 16:23:39 2017 -0700
mm: userfaultfd: add feature to request for a signal delivery
Signed-off-by: Prakash Sangappa <prakash.sangappa-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
v2: Incorporated review feedback changes.
---
man2/ioctl_userfaultfd.2 | 9 +++++++++
man2/userfaultfd.2 | 23 +++++++++++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
index 60fd29b..32f0744 100644
--- a/man2/ioctl_userfaultfd.2
+++ b/man2/ioctl_userfaultfd.2
@@ -196,6 +196,15 @@ with the
flag set,
.BR memfd_create (2),
and so on.
+.TP
+.B UFFD_FEATURE_SIGBUS
+Since Linux 4.14, If this feature bit is set, no page-fault events
+.B (UFFD_EVENT_PAGEFAULT)
+will be delivered, instead a
+.B SIGBUS
+signal will be sent to the faulting process. Applications using this
+feature will not require the use of a userfaultfd monitor for processing
+memory accesses to the regions registered with userfaultfd.
.IP
The returned
.I ioctls
diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
index 1741ee3..3c5b9c0 100644
--- a/man2/userfaultfd.2
+++ b/man2/userfaultfd.2
@@ -172,6 +172,29 @@ or
.BR ioctl (2)
operations to resolve the page fault.
.PP
+Starting from Linux 4.14, if application sets
+.B UFFD_FEATURE_SIGBUS
+feature bit using
+.B UFFDIO_API
+.BR ioctl (2),
+no page fault notification will be forwarded to
+the user-space, instead a
+.B SIGBUS
+signal is delivered to the faulting process. With this feature,
+userfaultfd can be used for robustness purpose 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 thru mapped address.
+.PP
+The
+.B UFFD_FEATURE_SIGBUS
+feature is implicitly inherited through fork() if used in combination with
+.BR UFFD_FEATURE_FORK .
+
+.PP
Details of the various
.BR ioctl (2)
operations can be found in
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] Userfaultfd: Add description for UFFD_FEATURE_SIGBUS
2017-10-09 22:45 [PATCH v2] Userfaultfd: Add description for UFFD_FEATURE_SIGBUS Prakash Sangappa
@ 2017-10-09 22:54 ` Andrea Arcangeli
2017-10-10 4:25 ` Mike Rapoport
2017-10-18 8:42 ` Michael Kerrisk (man-pages)
2 siblings, 0 replies; 4+ messages in thread
From: Andrea Arcangeli @ 2017-10-09 22:54 UTC (permalink / raw)
To: Prakash Sangappa
Cc: mtk.manpages, linux-man, linux-kernel, linux-api, linux-mm, rppt,
mhocko
On Mon, Oct 09, 2017 at 03:45:51PM -0700, Prakash Sangappa wrote:
> Userfaultfd feature UFFD_FEATURE_SIGBUS was merged recently and should
> be available in Linux 4.14 release. This patch is for the manpage
> changes documenting this API.
>
> Documents the following commit:
>
> commit 2d6d6f5a09a96cc1fec7ed992b825e05f64cb50e
> Author: Prakash Sangappa <prakash.sangappa@oracle.com>
> Date: Wed Sep 6 16:23:39 2017 -0700
>
> mm: userfaultfd: add feature to request for a signal delivery
>
> Signed-off-by: Prakash Sangappa <prakash.sangappa@oracle.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] Userfaultfd: Add description for UFFD_FEATURE_SIGBUS
2017-10-09 22:45 [PATCH v2] Userfaultfd: Add description for UFFD_FEATURE_SIGBUS Prakash Sangappa
2017-10-09 22:54 ` Andrea Arcangeli
@ 2017-10-10 4:25 ` Mike Rapoport
2017-10-18 8:42 ` Michael Kerrisk (man-pages)
2 siblings, 0 replies; 4+ messages in thread
From: Mike Rapoport @ 2017-10-10 4:25 UTC (permalink / raw)
To: Prakash Sangappa
Cc: mtk.manpages, linux-man, linux-kernel, linux-api, linux-mm,
aarcange, mhocko
On Mon, Oct 09, 2017 at 03:45:51PM -0700, Prakash Sangappa wrote:
> Userfaultfd feature UFFD_FEATURE_SIGBUS was merged recently and should
> be available in Linux 4.14 release. This patch is for the manpage
> changes documenting this API.
>
> Documents the following commit:
>
> commit 2d6d6f5a09a96cc1fec7ed992b825e05f64cb50e
> Author: Prakash Sangappa <prakash.sangappa@oracle.com>
> Date: Wed Sep 6 16:23:39 2017 -0700
>
> mm: userfaultfd: add feature to request for a signal delivery
>
> Signed-off-by: Prakash Sangappa <prakash.sangappa@oracle.com>
Reviewed-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> ---
> v2: Incorporated review feedback changes.
> ---
> man2/ioctl_userfaultfd.2 | 9 +++++++++
> man2/userfaultfd.2 | 23 +++++++++++++++++++++++
> 2 files changed, 32 insertions(+)
>
> diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
> index 60fd29b..32f0744 100644
> --- a/man2/ioctl_userfaultfd.2
> +++ b/man2/ioctl_userfaultfd.2
> @@ -196,6 +196,15 @@ with the
> flag set,
> .BR memfd_create (2),
> and so on.
> +.TP
> +.B UFFD_FEATURE_SIGBUS
> +Since Linux 4.14, If this feature bit is set, no page-fault events
> +.B (UFFD_EVENT_PAGEFAULT)
> +will be delivered, instead a
> +.B SIGBUS
> +signal will be sent to the faulting process. Applications using this
> +feature will not require the use of a userfaultfd monitor for processing
> +memory accesses to the regions registered with userfaultfd.
> .IP
> The returned
> .I ioctls
> diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
> index 1741ee3..3c5b9c0 100644
> --- a/man2/userfaultfd.2
> +++ b/man2/userfaultfd.2
> @@ -172,6 +172,29 @@ or
> .BR ioctl (2)
> operations to resolve the page fault.
> .PP
> +Starting from Linux 4.14, if application sets
> +.B UFFD_FEATURE_SIGBUS
> +feature bit using
> +.B UFFDIO_API
> +.BR ioctl (2),
> +no page fault notification will be forwarded to
> +the user-space, instead a
> +.B SIGBUS
> +signal is delivered to the faulting process. With this feature,
> +userfaultfd can be used for robustness purpose 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 thru mapped address.
> +.PP
> +The
> +.B UFFD_FEATURE_SIGBUS
> +feature is implicitly inherited through fork() if used in combination with
> +.BR UFFD_FEATURE_FORK .
> +
> +.PP
> Details of the various
> .BR ioctl (2)
> operations can be found in
> --
> 2.7.4
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] Userfaultfd: Add description for UFFD_FEATURE_SIGBUS
2017-10-09 22:45 [PATCH v2] Userfaultfd: Add description for UFFD_FEATURE_SIGBUS Prakash Sangappa
2017-10-09 22:54 ` Andrea Arcangeli
2017-10-10 4:25 ` Mike Rapoport
@ 2017-10-18 8:42 ` Michael Kerrisk (man-pages)
2 siblings, 0 replies; 4+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-10-18 8:42 UTC (permalink / raw)
To: Prakash Sangappa
Cc: mtk.manpages, linux-man, linux-kernel, linux-api, linux-mm,
aarcange, rppt, mhocko
Hello Prakash,
On 10/10/2017 12:45 AM, Prakash Sangappa wrote:
> Userfaultfd feature UFFD_FEATURE_SIGBUS was merged recently and should
> be available in Linux 4.14 release. This patch is for the manpage
> changes documenting this API.
>
> Documents the following commit:
>
> commit 2d6d6f5a09a96cc1fec7ed992b825e05f64cb50e
> Author: Prakash Sangappa <prakash.sangappa@oracle.com>
> Date: Wed Sep 6 16:23:39 2017 -0700
>
> mm: userfaultfd: add feature to request for a signal delivery
Thanks for the patch. I've applied it, and polished it a little.
The results are already visible in Git.
Thanks, Mike and Andrea, for the reviews!
Cheers,
Michael
> Signed-off-by: Prakash Sangappa <prakash.sangappa@oracle.com>
> ---
> v2: Incorporated review feedback changes.
> ---
> man2/ioctl_userfaultfd.2 | 9 +++++++++
> man2/userfaultfd.2 | 23 +++++++++++++++++++++++
> 2 files changed, 32 insertions(+)
>
> diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
> index 60fd29b..32f0744 100644
> --- a/man2/ioctl_userfaultfd.2
> +++ b/man2/ioctl_userfaultfd.2
> @@ -196,6 +196,15 @@ with the
> flag set,
> .BR memfd_create (2),
> and so on.
> +.TP
> +.B UFFD_FEATURE_SIGBUS
> +Since Linux 4.14, If this feature bit is set, no page-fault events
> +.B (UFFD_EVENT_PAGEFAULT)
> +will be delivered, instead a
> +.B SIGBUS
> +signal will be sent to the faulting process. Applications using this
> +feature will not require the use of a userfaultfd monitor for processing
> +memory accesses to the regions registered with userfaultfd.
> .IP
> The returned
> .I ioctls
> diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
> index 1741ee3..3c5b9c0 100644
> --- a/man2/userfaultfd.2
> +++ b/man2/userfaultfd.2
> @@ -172,6 +172,29 @@ or
> .BR ioctl (2)
> operations to resolve the page fault.
> .PP
> +Starting from Linux 4.14, if application sets
> +.B UFFD_FEATURE_SIGBUS
> +feature bit using
> +.B UFFDIO_API
> +.BR ioctl (2),
> +no page fault notification will be forwarded to
> +the user-space, instead a
> +.B SIGBUS
> +signal is delivered to the faulting process. With this feature,
> +userfaultfd can be used for robustness purpose 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 thru mapped address.
> +.PP
> +The
> +.B UFFD_FEATURE_SIGBUS
> +feature is implicitly inherited through fork() if used in combination with
> +.BR UFFD_FEATURE_FORK .
> +
> +.PP
> Details of the various
> .BR ioctl (2)
> operations can be found in
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-18 8:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-09 22:45 [PATCH v2] Userfaultfd: Add description for UFFD_FEATURE_SIGBUS Prakash Sangappa
2017-10-09 22:54 ` Andrea Arcangeli
2017-10-10 4:25 ` Mike Rapoport
2017-10-18 8:42 ` Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).