linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update
@ 2017-05-01  5:43 Mike Rapoport
  2017-05-01  5:43 ` [PATCH man-pages 1/5] ioctl_userfaultfd.2: update description of shared memory areas Mike Rapoport
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Mike Rapoport @ 2017-05-01  5:43 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, linux-man, Mike Rapoport

Hi Michael,

These updates pretty much complete the coverage of 4.11 additions, IMHO.

Mike Rapoport (5):
  ioctl_userfaultfd.2: update description of shared memory areas
  ioctl_userfaultfd.2: UFFDIO_COPY: add ENOENT and ENOSPC description
  ioctl_userfaultfd.2: add BUGS section
  userfaultfd.2: add note about asynchronios events delivery
  userfaultfd.2: update VERSIONS section with 4.11 chanegs

 man2/ioctl_userfaultfd.2 | 35 +++++++++++++++++++++++++++++++++--
 man2/userfaultfd.2       | 15 +++++++++++++++
 2 files changed, 48 insertions(+), 2 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH man-pages 1/5] ioctl_userfaultfd.2: update description of shared memory areas
  2017-05-01  5:43 [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Mike Rapoport
@ 2017-05-01  5:43 ` Mike Rapoport
  2017-05-01 18:33   ` Michael Kerrisk (man-pages)
  2017-05-01  5:43 ` [PATCH man-pages 2/5] ioctl_userfaultfd.2: UFFDIO_COPY: add ENOENT and ENOSPC description Mike Rapoport
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Mike Rapoport @ 2017-05-01  5:43 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, linux-man, Mike Rapoport

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
 man2/ioctl_userfaultfd.2 | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
index 889feb9..6edd396 100644
--- a/man2/ioctl_userfaultfd.2
+++ b/man2/ioctl_userfaultfd.2
@@ -181,8 +181,17 @@ virtual memory areas
 .TP
 .B UFFD_FEATURE_MISSING_SHMEM
 If this feature bit is set,
-the kernel supports registering userfaultfd ranges on tmpfs
-virtual memory areas
+the kernel supports registering userfaultfd ranges on shared memory areas.
+This includes all kernel shared memory APIs:
+System V shared memory,
+tmpfs,
+/dev/zero,
+.BR mmap(2)
+with
+.I MAP_SHARED
+flag set,
+.BR memfd_create (2),
+etc.
 
 The returned
 .I ioctls
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH man-pages 2/5] ioctl_userfaultfd.2: UFFDIO_COPY: add ENOENT and ENOSPC description
  2017-05-01  5:43 [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Mike Rapoport
  2017-05-01  5:43 ` [PATCH man-pages 1/5] ioctl_userfaultfd.2: update description of shared memory areas Mike Rapoport
@ 2017-05-01  5:43 ` Mike Rapoport
  2017-05-01 18:33   ` Michael Kerrisk (man-pages)
  2017-05-01  5:43 ` [PATCH man-pages 3/5] ioctl_userfaultfd.2: add BUGS section Mike Rapoport
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Mike Rapoport @ 2017-05-01  5:43 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, linux-man, Mike Rapoport

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
 man2/ioctl_userfaultfd.2 | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
index 6edd396..e12b9de 100644
--- a/man2/ioctl_userfaultfd.2
+++ b/man2/ioctl_userfaultfd.2
@@ -481,6 +481,19 @@ was invalid.
 An invalid bit was specified in the
 .IR mode
 field.
+.TP
+.B ENOENT
+(Since Linux 4.11)
+The faulting process has changed
+its virtual memory layout simultaneously with outstanding
+.I UFFDIO_COPY
+operation.
+.TP
+.B ENOSPC
+(Since Linux 4.11)
+The faulting process has exited at the time of
+.I UFFDIO_COPY
+operation.
 .\"
 .SS UFFDIO_ZEROPAGE
 (Since Linux 4.3.)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH man-pages 3/5] ioctl_userfaultfd.2: add BUGS section
  2017-05-01  5:43 [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Mike Rapoport
  2017-05-01  5:43 ` [PATCH man-pages 1/5] ioctl_userfaultfd.2: update description of shared memory areas Mike Rapoport
  2017-05-01  5:43 ` [PATCH man-pages 2/5] ioctl_userfaultfd.2: UFFDIO_COPY: add ENOENT and ENOSPC description Mike Rapoport
@ 2017-05-01  5:43 ` Mike Rapoport
  2017-05-01 18:33   ` Michael Kerrisk (man-pages)
  2017-05-01  5:43 ` [PATCH man-pages 4/5] userfaultfd.2: add note about asynchronios events delivery Mike Rapoport
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Mike Rapoport @ 2017-05-01  5:43 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, linux-man, Mike Rapoport

The features handshake is not quite convenient.
Elaborate about it in the BUGS section.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
 man2/ioctl_userfaultfd.2 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
index e12b9de..50316de 100644
--- a/man2/ioctl_userfaultfd.2
+++ b/man2/ioctl_userfaultfd.2
@@ -650,6 +650,15 @@ operations are Linux-specific.
 .SH EXAMPLE
 See
 .BR userfaultfd (2).
+.SH BUGS
+In order to detect available userfault features and
+enable certain subset of those features
+the usefault file descriptor must be closed after the first
+.BR UFFDIO_API
+operation that queries features availability and re-opened before
+the second
+.BR UFFDIO_API
+call that actually enables the desired features.
 .SH SEE ALSO
 .BR ioctl (2),
 .BR mmap (2),
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH man-pages 4/5] userfaultfd.2: add note about asynchronios events delivery
  2017-05-01  5:43 [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Mike Rapoport
                   ` (2 preceding siblings ...)
  2017-05-01  5:43 ` [PATCH man-pages 3/5] ioctl_userfaultfd.2: add BUGS section Mike Rapoport
@ 2017-05-01  5:43 ` Mike Rapoport
  2017-05-01 18:33   ` Michael Kerrisk (man-pages)
  2017-05-01  5:43 ` [PATCH man-pages 5/5] userfaultfd.2: update VERSIONS section with 4.11 chanegs Mike Rapoport
  2017-05-01 18:34 ` [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Michael Kerrisk (man-pages)
  5 siblings, 1 reply; 19+ messages in thread
From: Mike Rapoport @ 2017-05-01  5:43 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, linux-man, Mike Rapoport

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
 man2/userfaultfd.2 | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
index 8b89162..f177bba 100644
--- a/man2/userfaultfd.2
+++ b/man2/userfaultfd.2
@@ -112,6 +112,18 @@ created for the child process,
 which allows userfaultfd monitor to perform user-space paging
 for the child process.
 
+Unlike page faults which have to be synchronous and require
+explicit or implicit wakeup,
+all other events are delivered asynchronously and
+the non-cooperative process resumes execution as
+soon as manager executes
+.BR read(2).
+The userfaultfd manager should carefully synchronize calls
+to UFFDIO_COPY with the events processing.
+
+The current asynchronous model of the event delivery is optimal for
+single threaded non-cooperative userfaultfd manager implementations.
+
 .\" FIXME elaborate about non-cooperating mode, describe its limitations
 .\" for kernels before 4.11, features added in 4.11
 .\" and limitations remaining in 4.11
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH man-pages 5/5] userfaultfd.2: update VERSIONS section with 4.11 chanegs
  2017-05-01  5:43 [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Mike Rapoport
                   ` (3 preceding siblings ...)
  2017-05-01  5:43 ` [PATCH man-pages 4/5] userfaultfd.2: add note about asynchronios events delivery Mike Rapoport
@ 2017-05-01  5:43 ` Mike Rapoport
  2017-05-01 18:33   ` Michael Kerrisk (man-pages)
  2017-05-01 18:34 ` [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Michael Kerrisk (man-pages)
  5 siblings, 1 reply; 19+ messages in thread
From: Mike Rapoport @ 2017-05-01  5:43 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, linux-man, Mike Rapoport

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
 man2/userfaultfd.2 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
index f177bba..07a69f1 100644
--- a/man2/userfaultfd.2
+++ b/man2/userfaultfd.2
@@ -404,6 +404,9 @@ Insufficient kernel memory was available.
 The
 .BR userfaultfd ()
 system call first appeared in Linux 4.3.
+
+The support for hugetlbfs and shared memory areas and
+non-page-fault events was added in Linux 4.11
 .SH CONFORMING TO
 .BR userfaultfd ()
 is Linux-specific and should not be used in programs intended to be
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH man-pages 1/5] ioctl_userfaultfd.2: update description of shared memory areas
  2017-05-01  5:43 ` [PATCH man-pages 1/5] ioctl_userfaultfd.2: update description of shared memory areas Mike Rapoport
@ 2017-05-01 18:33   ` Michael Kerrisk (man-pages)
  2017-05-02  9:31     ` Mike Rapoport
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-05-01 18:33 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: mtk.manpages, Andrea Arcangeli, linux-kernel, linux-mm, linux-man

Hello Mike,

I've applied this patch, but  have a question.

On 05/01/2017 07:43 AM, Mike Rapoport wrote:
> Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> ---
>  man2/ioctl_userfaultfd.2 | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
> index 889feb9..6edd396 100644
> --- a/man2/ioctl_userfaultfd.2
> +++ b/man2/ioctl_userfaultfd.2
> @@ -181,8 +181,17 @@ virtual memory areas
>  .TP
>  .B UFFD_FEATURE_MISSING_SHMEM
>  If this feature bit is set,
> -the kernel supports registering userfaultfd ranges on tmpfs
> -virtual memory areas
> +the kernel supports registering userfaultfd ranges on shared memory areas.
> +This includes all kernel shared memory APIs:
> +System V shared memory,
> +tmpfs,
> +/dev/zero,
> +.BR mmap(2)
> +with
> +.I MAP_SHARED
> +flag set,
> +.BR memfd_create (2),
> +etc.
>  
>  The returned
>  .I ioctls

Does the change in this patch represent a change that occurred in
Linux 4.11? If so, I think this needs to be said explicitly in the text.

Cheers,

Michael



-- 
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] 19+ messages in thread

* Re: [PATCH man-pages 2/5] ioctl_userfaultfd.2: UFFDIO_COPY: add ENOENT and ENOSPC description
  2017-05-01  5:43 ` [PATCH man-pages 2/5] ioctl_userfaultfd.2: UFFDIO_COPY: add ENOENT and ENOSPC description Mike Rapoport
@ 2017-05-01 18:33   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-05-01 18:33 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: mtk.manpages, Andrea Arcangeli, linux-kernel, linux-mm, linux-man

On 05/01/2017 07:43 AM, Mike Rapoport wrote:
> Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>

Thanks, Mike. Applied.

Cheers,

Michael


> ---
>  man2/ioctl_userfaultfd.2 | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
> index 6edd396..e12b9de 100644
> --- a/man2/ioctl_userfaultfd.2
> +++ b/man2/ioctl_userfaultfd.2
> @@ -481,6 +481,19 @@ was invalid.
>  An invalid bit was specified in the
>  .IR mode
>  field.
> +.TP
> +.B ENOENT
> +(Since Linux 4.11)
> +The faulting process has changed
> +its virtual memory layout simultaneously with outstanding
> +.I UFFDIO_COPY
> +operation.
> +.TP
> +.B ENOSPC
> +(Since Linux 4.11)
> +The faulting process has exited at the time of
> +.I UFFDIO_COPY
> +operation.
>  .\"
>  .SS UFFDIO_ZEROPAGE
>  (Since Linux 4.3.)
> 


-- 
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] 19+ messages in thread

* Re: [PATCH man-pages 4/5] userfaultfd.2: add note about asynchronios events delivery
  2017-05-01  5:43 ` [PATCH man-pages 4/5] userfaultfd.2: add note about asynchronios events delivery Mike Rapoport
@ 2017-05-01 18:33   ` Michael Kerrisk (man-pages)
  2017-05-02  9:46     ` Mike Rapoport
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-05-01 18:33 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: mtk.manpages, Andrea Arcangeli, linux-kernel, linux-mm, linux-man

Hi Mike,

On 05/01/2017 07:43 AM, Mike Rapoport wrote:
> Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>

Thanks. Applied. One question below.

> ---
>  man2/userfaultfd.2 | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
> index 8b89162..f177bba 100644
> --- a/man2/userfaultfd.2
> +++ b/man2/userfaultfd.2
> @@ -112,6 +112,18 @@ created for the child process,
>  which allows userfaultfd monitor to perform user-space paging
>  for the child process.
>  
> +Unlike page faults which have to be synchronous and require
> +explicit or implicit wakeup,
> +all other events are delivered asynchronously and
> +the non-cooperative process resumes execution as
> +soon as manager executes
> +.BR read(2).
> +The userfaultfd manager should carefully synchronize calls
> +to UFFDIO_COPY with the events processing.
> +
> +The current asynchronous model of the event delivery is optimal for
> +single threaded non-cooperative userfaultfd manager implementations.

The preceding paragraph feels incomplete. It seems like you want to make
a point with that last sentence, but the point is not explicit. What's
missing?

> +
>  .\" FIXME elaborate about non-cooperating mode, describe its limitations
>  .\" for kernels before 4.11, features added in 4.11
>  .\" and limitations remaining in 4.11
> 

Cheers,

Michael



-- 
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] 19+ messages in thread

* Re: [PATCH man-pages 3/5] ioctl_userfaultfd.2: add BUGS section
  2017-05-01  5:43 ` [PATCH man-pages 3/5] ioctl_userfaultfd.2: add BUGS section Mike Rapoport
@ 2017-05-01 18:33   ` Michael Kerrisk (man-pages)
  2017-05-02  9:32     ` Mike Rapoport
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-05-01 18:33 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: mtk.manpages, Andrea Arcangeli, linux-kernel, linux-mm, linux-man

Hi Mike,

I've applied this, but have a question.

On 05/01/2017 07:43 AM, Mike Rapoport wrote:
> The features handshake is not quite convenient.
> Elaborate about it in the BUGS section.
> 
> Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> ---
>  man2/ioctl_userfaultfd.2 | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
> index e12b9de..50316de 100644
> --- a/man2/ioctl_userfaultfd.2
> +++ b/man2/ioctl_userfaultfd.2
> @@ -650,6 +650,15 @@ operations are Linux-specific.
>  .SH EXAMPLE
>  See
>  .BR userfaultfd (2).
> +.SH BUGS
> +In order to detect available userfault features and
> +enable certain subset of those features

I changed "certain" to "some". ("certain subset" here also
would sound like "some particular subset" of those features.)
Okay?

> +the usefault file descriptor must be closed after the first
> +.BR UFFDIO_API
> +operation that queries features availability and re-opened before
> +the second
> +.BR UFFDIO_API
> +call that actually enables the desired features.
>  .SH SEE ALSO
>  .BR ioctl (2),
>  .BR mmap (2),

Cheers,

Michael



-- 
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] 19+ messages in thread

* Re: [PATCH man-pages 5/5] userfaultfd.2: update VERSIONS section with 4.11 chanegs
  2017-05-01  5:43 ` [PATCH man-pages 5/5] userfaultfd.2: update VERSIONS section with 4.11 chanegs Mike Rapoport
@ 2017-05-01 18:33   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-05-01 18:33 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: mtk.manpages, Andrea Arcangeli, linux-kernel, linux-mm, linux-man

Hi Mike,

On 05/01/2017 07:43 AM, Mike Rapoport wrote:
> Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>

Thanks. Applied.

Cheers,

Michael


> ---
>  man2/userfaultfd.2 | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
> index f177bba..07a69f1 100644
> --- a/man2/userfaultfd.2
> +++ b/man2/userfaultfd.2
> @@ -404,6 +404,9 @@ Insufficient kernel memory was available.
>  The
>  .BR userfaultfd ()
>  system call first appeared in Linux 4.3.
> +
> +The support for hugetlbfs and shared memory areas and
> +non-page-fault events was added in Linux 4.11
>  .SH CONFORMING TO
>  .BR userfaultfd ()
>  is Linux-specific and should not be used in programs intended to be
> 


-- 
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] 19+ messages in thread

* Re: [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update
  2017-05-01  5:43 [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Mike Rapoport
                   ` (4 preceding siblings ...)
  2017-05-01  5:43 ` [PATCH man-pages 5/5] userfaultfd.2: update VERSIONS section with 4.11 chanegs Mike Rapoport
@ 2017-05-01 18:34 ` Michael Kerrisk (man-pages)
  2017-05-02  9:48   ` Mike Rapoport
  5 siblings, 1 reply; 19+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-05-01 18:34 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: mtk.manpages, Andrea Arcangeli, linux-kernel, linux-mm, linux-man

Hi Mike,

On 05/01/2017 07:43 AM, Mike Rapoport wrote:
> Hi Michael,
> 
> These updates pretty much complete the coverage of 4.11 additions, IMHO.

Thanks for this, but we still await input from Andrea
on various points.

> Mike Rapoport (5):
>   ioctl_userfaultfd.2: update description of shared memory areas
>   ioctl_userfaultfd.2: UFFDIO_COPY: add ENOENT and ENOSPC description
>   ioctl_userfaultfd.2: add BUGS section
>   userfaultfd.2: add note about asynchronios events delivery
>   userfaultfd.2: update VERSIONS section with 4.11 chanegs
> 
>  man2/ioctl_userfaultfd.2 | 35 +++++++++++++++++++++++++++++++++--
>  man2/userfaultfd.2       | 15 +++++++++++++++
>  2 files changed, 48 insertions(+), 2 deletions(-)

I've applied all of the above, and done some light editing.

Could you please check my changes in the following commits:

5191c68806c8ac73fdc89586cde434d2766abb5c
265225c1e2311ae26ead116e6c8d2cedd46144fa

Thanks,

Michael

-- 
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] 19+ messages in thread

* Re: [PATCH man-pages 1/5] ioctl_userfaultfd.2: update description of shared memory areas
  2017-05-01 18:33   ` Michael Kerrisk (man-pages)
@ 2017-05-02  9:31     ` Mike Rapoport
  2017-05-02 20:23       ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 19+ messages in thread
From: Mike Rapoport @ 2017-05-02  9:31 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, linux-man

On Mon, May 01, 2017 at 08:33:31PM +0200, Michael Kerrisk (man-pages) wrote:
> Hello Mike,
> 
> I've applied this patch, but  have a question.
> 
> On 05/01/2017 07:43 AM, Mike Rapoport wrote:
> > Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> > ---
> >  man2/ioctl_userfaultfd.2 | 13 +++++++++++--
> >  1 file changed, 11 insertions(+), 2 deletions(-)
> > 
> > diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
> > index 889feb9..6edd396 100644
> > --- a/man2/ioctl_userfaultfd.2
> > +++ b/man2/ioctl_userfaultfd.2
> > @@ -181,8 +181,17 @@ virtual memory areas
> >  .TP
> >  .B UFFD_FEATURE_MISSING_SHMEM
> >  If this feature bit is set,
> > -the kernel supports registering userfaultfd ranges on tmpfs
> > -virtual memory areas
> > +the kernel supports registering userfaultfd ranges on shared memory areas.
> > +This includes all kernel shared memory APIs:
> > +System V shared memory,
> > +tmpfs,
> > +/dev/zero,
> > +.BR mmap(2)
> > +with
> > +.I MAP_SHARED
> > +flag set,
> > +.BR memfd_create (2),
> > +etc.
> >  
> >  The returned
> >  .I ioctls
> 
> Does the change in this patch represent a change that occurred in
> Linux 4.11? If so, I think this needs to be said explicitly in the text.

The patch only extends the description of UFFD_FEATURE_MISSING_SHMEM. The
feature is indeed available from 4.11, but that is said a few lives above
(line 136 in ioctl_userfaultfd.2)
 
> Cheers,
> 
> Michael
> 
> 
> 
> -- 
> 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] 19+ messages in thread

* Re: [PATCH man-pages 3/5] ioctl_userfaultfd.2: add BUGS section
  2017-05-01 18:33   ` Michael Kerrisk (man-pages)
@ 2017-05-02  9:32     ` Mike Rapoport
  0 siblings, 0 replies; 19+ messages in thread
From: Mike Rapoport @ 2017-05-02  9:32 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, linux-man

On Mon, May 01, 2017 at 08:33:50PM +0200, Michael Kerrisk (man-pages) wrote:
> Hi Mike,
> 
> I've applied this, but have a question.
> 
> On 05/01/2017 07:43 AM, Mike Rapoport wrote:
> > The features handshake is not quite convenient.
> > Elaborate about it in the BUGS section.
> > 
> > Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> > ---
> >  man2/ioctl_userfaultfd.2 | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
> > index e12b9de..50316de 100644
> > --- a/man2/ioctl_userfaultfd.2
> > +++ b/man2/ioctl_userfaultfd.2
> > @@ -650,6 +650,15 @@ operations are Linux-specific.
> >  .SH EXAMPLE
> >  See
> >  .BR userfaultfd (2).
> > +.SH BUGS
> > +In order to detect available userfault features and
> > +enable certain subset of those features
> 
> I changed "certain" to "some". ("certain subset" here also
> would sound like "some particular subset" of those features.)
> Okay?
 
Yes, sure.

> > +the usefault file descriptor must be closed after the first
> > +.BR UFFDIO_API
> > +operation that queries features availability and re-opened before
> > +the second
> > +.BR UFFDIO_API
> > +call that actually enables the desired features.
> >  .SH SEE ALSO
> >  .BR ioctl (2),
> >  .BR mmap (2),
> 
> Cheers,
> 
> Michael
> 
> 
> 
> -- 
> 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] 19+ messages in thread

* Re: [PATCH man-pages 4/5] userfaultfd.2: add note about asynchronios events delivery
  2017-05-01 18:33   ` Michael Kerrisk (man-pages)
@ 2017-05-02  9:46     ` Mike Rapoport
  2017-05-02 20:27       ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 19+ messages in thread
From: Mike Rapoport @ 2017-05-02  9:46 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, linux-man

On Mon, May 01, 2017 at 08:33:45PM +0200, Michael Kerrisk (man-pages) wrote:
> Hi Mike,
> 
> On 05/01/2017 07:43 AM, Mike Rapoport wrote:
> > Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> 
> Thanks. Applied. One question below.
> 
> > ---
> >  man2/userfaultfd.2 | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
> > index 8b89162..f177bba 100644
> > --- a/man2/userfaultfd.2
> > +++ b/man2/userfaultfd.2
> > @@ -112,6 +112,18 @@ created for the child process,
> >  which allows userfaultfd monitor to perform user-space paging
> >  for the child process.
> >  
> > +Unlike page faults which have to be synchronous and require
> > +explicit or implicit wakeup,
> > +all other events are delivered asynchronously and
> > +the non-cooperative process resumes execution as
> > +soon as manager executes
> > +.BR read(2).
> > +The userfaultfd manager should carefully synchronize calls
> > +to UFFDIO_COPY with the events processing.
> > +
> > +The current asynchronous model of the event delivery is optimal for
> > +single threaded non-cooperative userfaultfd manager implementations.
> 
> The preceding paragraph feels incomplete. It seems like you want to make
> a point with that last sentence, but the point is not explicit. What's
> missing?

I've copied both from Documentation/vm/userfaulftfd.txt, and there we also
talk about possibility of addition of synchronous events delivery and
that makes the paragraph above to seem crippled :)
The major point here is that current events delivery model could be
problematic for multi-threaded monitor. I even suspect that it would be
impossible to ensure synchronization between page faults and non-page
fault events in multi-threaded monitor.
 
> > +
> >  .\" FIXME elaborate about non-cooperating mode, describe its limitations
> >  .\" for kernels before 4.11, features added in 4.11
> >  .\" and limitations remaining in 4.11
> > 
> 
> Cheers,
> 
> Michael
> 
> 
> 
> -- 
> 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] 19+ messages in thread

* Re: [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update
  2017-05-01 18:34 ` [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Michael Kerrisk (man-pages)
@ 2017-05-02  9:48   ` Mike Rapoport
  2017-05-02 20:28     ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 19+ messages in thread
From: Mike Rapoport @ 2017-05-02  9:48 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, linux-man

On Mon, May 01, 2017 at 08:34:07PM +0200, Michael Kerrisk (man-pages) wrote:
> Hi Mike,
> 
> On 05/01/2017 07:43 AM, Mike Rapoport wrote:
> > Hi Michael,
> > 
> > These updates pretty much complete the coverage of 4.11 additions, IMHO.
> 
> Thanks for this, but we still await input from Andrea
> on various points.
> 
> > Mike Rapoport (5):
> >   ioctl_userfaultfd.2: update description of shared memory areas
> >   ioctl_userfaultfd.2: UFFDIO_COPY: add ENOENT and ENOSPC description
> >   ioctl_userfaultfd.2: add BUGS section
> >   userfaultfd.2: add note about asynchronios events delivery
> >   userfaultfd.2: update VERSIONS section with 4.11 chanegs
> > 
> >  man2/ioctl_userfaultfd.2 | 35 +++++++++++++++++++++++++++++++++--
> >  man2/userfaultfd.2       | 15 +++++++++++++++
> >  2 files changed, 48 insertions(+), 2 deletions(-)
> 
> I've applied all of the above, and done some light editing.
> 
> Could you please check my changes in the following commits:
> 
> 5191c68806c8ac73fdc89586cde434d2766abb5c
> 265225c1e2311ae26ead116e6c8d2cedd46144fa

Both are Ok
Reviewed-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
 
> Thanks,
> 
> Michael
> 
> -- 
> 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] 19+ messages in thread

* Re: [PATCH man-pages 1/5] ioctl_userfaultfd.2: update description of shared memory areas
  2017-05-02  9:31     ` Mike Rapoport
@ 2017-05-02 20:23       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-05-02 20:23 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: mtk.manpages, Andrea Arcangeli, linux-kernel, linux-mm, linux-man

On 05/02/2017 11:31 AM, Mike Rapoport wrote:
> On Mon, May 01, 2017 at 08:33:31PM +0200, Michael Kerrisk (man-pages) wrote:
>> Hello Mike,
>>
>> I've applied this patch, but  have a question.
>>
>> On 05/01/2017 07:43 AM, Mike Rapoport wrote:
>>> Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
>>> ---
>>>  man2/ioctl_userfaultfd.2 | 13 +++++++++++--
>>>  1 file changed, 11 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2
>>> index 889feb9..6edd396 100644
>>> --- a/man2/ioctl_userfaultfd.2
>>> +++ b/man2/ioctl_userfaultfd.2
>>> @@ -181,8 +181,17 @@ virtual memory areas
>>>  .TP
>>>  .B UFFD_FEATURE_MISSING_SHMEM
>>>  If this feature bit is set,
>>> -the kernel supports registering userfaultfd ranges on tmpfs
>>> -virtual memory areas
>>> +the kernel supports registering userfaultfd ranges on shared memory areas.
>>> +This includes all kernel shared memory APIs:
>>> +System V shared memory,
>>> +tmpfs,
>>> +/dev/zero,
>>> +.BR mmap(2)
>>> +with
>>> +.I MAP_SHARED
>>> +flag set,
>>> +.BR memfd_create (2),
>>> +etc.
>>>  
>>>  The returned
>>>  .I ioctls
>>
>> Does the change in this patch represent a change that occurred in
>> Linux 4.11? If so, I think this needs to be said explicitly in the text.
> 
> The patch only extends the description of UFFD_FEATURE_MISSING_SHMEM. The
> feature is indeed available from 4.11, but that is said a few lives above
> (line 136 in ioctl_userfaultfd.2)

Okay -- thanks for the clarification.

Cheers,

Michael


-- 
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] 19+ messages in thread

* Re: [PATCH man-pages 4/5] userfaultfd.2: add note about asynchronios events delivery
  2017-05-02  9:46     ` Mike Rapoport
@ 2017-05-02 20:27       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-05-02 20:27 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: mtk.manpages, Andrea Arcangeli, linux-kernel, linux-mm, linux-man

On 05/02/2017 11:46 AM, Mike Rapoport wrote:
> On Mon, May 01, 2017 at 08:33:45PM +0200, Michael Kerrisk (man-pages) wrote:
>> Hi Mike,
>>
>> On 05/01/2017 07:43 AM, Mike Rapoport wrote:
>>> Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
>>
>> Thanks. Applied. One question below.
>>
>>> ---
>>>  man2/userfaultfd.2 | 12 ++++++++++++
>>>  1 file changed, 12 insertions(+)
>>>
>>> diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
>>> index 8b89162..f177bba 100644
>>> --- a/man2/userfaultfd.2
>>> +++ b/man2/userfaultfd.2
>>> @@ -112,6 +112,18 @@ created for the child process,
>>>  which allows userfaultfd monitor to perform user-space paging
>>>  for the child process.
>>>  
>>> +Unlike page faults which have to be synchronous and require
>>> +explicit or implicit wakeup,
>>> +all other events are delivered asynchronously and
>>> +the non-cooperative process resumes execution as
>>> +soon as manager executes
>>> +.BR read(2).
>>> +The userfaultfd manager should carefully synchronize calls
>>> +to UFFDIO_COPY with the events processing.
>>> +
>>> +The current asynchronous model of the event delivery is optimal for
>>> +single threaded non-cooperative userfaultfd manager implementations.
>>
>> The preceding paragraph feels incomplete. It seems like you want to make
>> a point with that last sentence, but the point is not explicit. What's
>> missing?
> 
> I've copied both from Documentation/vm/userfaulftfd.txt, and there we also
> talk about possibility of addition of synchronous events delivery and
> that makes the paragraph above to seem crippled :)
> The major point here is that current events delivery model could be
> problematic for multi-threaded monitor. I even suspect that it would be
> impossible to ensure synchronization between page faults and non-page
> fault events in multi-threaded monitor.

Okay -- thanks for the info. I've noted it, but won't make changes 
any changes to the page for now.

Cheers,

Michael



-- 
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] 19+ messages in thread

* Re: [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update
  2017-05-02  9:48   ` Mike Rapoport
@ 2017-05-02 20:28     ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-05-02 20:28 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: mtk.manpages, Andrea Arcangeli, linux-kernel, linux-mm, linux-man

On 05/02/2017 11:48 AM, Mike Rapoport wrote:
> On Mon, May 01, 2017 at 08:34:07PM +0200, Michael Kerrisk (man-pages) wrote:
>> Hi Mike,
>>
>> On 05/01/2017 07:43 AM, Mike Rapoport wrote:
>>> Hi Michael,
>>>
>>> These updates pretty much complete the coverage of 4.11 additions, IMHO.
>>
>> Thanks for this, but we still await input from Andrea
>> on various points.
>>
>>> Mike Rapoport (5):
>>>   ioctl_userfaultfd.2: update description of shared memory areas
>>>   ioctl_userfaultfd.2: UFFDIO_COPY: add ENOENT and ENOSPC description
>>>   ioctl_userfaultfd.2: add BUGS section
>>>   userfaultfd.2: add note about asynchronios events delivery
>>>   userfaultfd.2: update VERSIONS section with 4.11 chanegs
>>>
>>>  man2/ioctl_userfaultfd.2 | 35 +++++++++++++++++++++++++++++++++--
>>>  man2/userfaultfd.2       | 15 +++++++++++++++
>>>  2 files changed, 48 insertions(+), 2 deletions(-)
>>
>> I've applied all of the above, and done some light editing.
>>
>> Could you please check my changes in the following commits:
>>
>> 5191c68806c8ac73fdc89586cde434d2766abb5c
>> 265225c1e2311ae26ead116e6c8d2cedd46144fa
> 
> Both are Ok
> Reviewed-by: Mike Rapoport <rppt@linux.vnet.ibm.com>

Thanks for checking, Mike.

Cheers,

Michael



-- 
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] 19+ messages in thread

end of thread, other threads:[~2017-05-02 20:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-01  5:43 [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Mike Rapoport
2017-05-01  5:43 ` [PATCH man-pages 1/5] ioctl_userfaultfd.2: update description of shared memory areas Mike Rapoport
2017-05-01 18:33   ` Michael Kerrisk (man-pages)
2017-05-02  9:31     ` Mike Rapoport
2017-05-02 20:23       ` Michael Kerrisk (man-pages)
2017-05-01  5:43 ` [PATCH man-pages 2/5] ioctl_userfaultfd.2: UFFDIO_COPY: add ENOENT and ENOSPC description Mike Rapoport
2017-05-01 18:33   ` Michael Kerrisk (man-pages)
2017-05-01  5:43 ` [PATCH man-pages 3/5] ioctl_userfaultfd.2: add BUGS section Mike Rapoport
2017-05-01 18:33   ` Michael Kerrisk (man-pages)
2017-05-02  9:32     ` Mike Rapoport
2017-05-01  5:43 ` [PATCH man-pages 4/5] userfaultfd.2: add note about asynchronios events delivery Mike Rapoport
2017-05-01 18:33   ` Michael Kerrisk (man-pages)
2017-05-02  9:46     ` Mike Rapoport
2017-05-02 20:27       ` Michael Kerrisk (man-pages)
2017-05-01  5:43 ` [PATCH man-pages 5/5] userfaultfd.2: update VERSIONS section with 4.11 chanegs Mike Rapoport
2017-05-01 18:33   ` Michael Kerrisk (man-pages)
2017-05-01 18:34 ` [PATCH man-pages 0/5] {ioctl_}userfaultfd.2: yet another update Michael Kerrisk (man-pages)
2017-05-02  9:48   ` Mike Rapoport
2017-05-02 20:28     ` 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).