2021-02-04 20:06:11

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH v4 09/10] userfaultfd: update documentation to describe minor fault handling

Hi Axel-

one typo found:

On 2/4/21 10:34 AM, Axel Rasmussen wrote:
> Reword / reorganize things a little bit into "lists", so new features /
> modes / ioctls can sort of just be appended.

Good plan.

>
> Signed-off-by: Axel Rasmussen <[email protected]>
> ---
> Documentation/admin-guide/mm/userfaultfd.rst | 107 ++++++++++++-------
> 1 file changed, 66 insertions(+), 41 deletions(-)
>
> diff --git a/Documentation/admin-guide/mm/userfaultfd.rst b/Documentation/admin-guide/mm/userfaultfd.rst
> index 65eefa66c0ba..cfd3daf59d0e 100644
> --- a/Documentation/admin-guide/mm/userfaultfd.rst
> +++ b/Documentation/admin-guide/mm/userfaultfd.rst

[snip]

> -
> -Once the ``userfaultfd`` has been enabled the ``UFFDIO_REGISTER`` ioctl should
> -be invoked (if present in the returned ``uffdio_api.ioctls`` bitmask) to
> -register a memory range in the ``userfaultfd`` by setting the
> +events, except page fault notifications, may be generated:
> +
> +- The ``UFFD_FEATURE_EVENT_*`` flags indicate that various other events
> + other than page faults are supported. These events are described in more
> + detail below in the `Non-cooperative userfaultfd`_ section.
> +
> +- ``UFFD_FEATURE_MISSING_HUGETLBFS`` and ``UFFD_FEATURE_MISSING_SHMEM``
> + indicate that the kernel supports ``UFFDIO_REGISTER_MODE_MISSING``
> + registrations for hugetlbfs and shared memory (covering all shmem APIs,
> + i.e. tmpfs, ``IPCSHM``, ``/dev/zero``, ``MAP_SHARED``, ``memfd_create``,
> + etc) virtual memory areas, respectively.
> +
> +- ``UFFD_FEATURE_MINOR_HUGETLBFS`` indicates that the kernel supports
> + ``UFFDIO_REGISTER_MODE_MINOR`` registration for hugetlbfs virtual memory
> + areas.
> +
> +The userland application should set the feature flags it intends to use

(ah, userspace has moved to userland temporarily. :)

> +when envoking the ``UFFDIO_API`` ioctl, to request that those features be

invoking

> +enabled if supported.


thanks.
--
~Randy


2021-02-04 21:09:38

by Axel Rasmussen

[permalink] [raw]
Subject: Re: [PATCH v4 09/10] userfaultfd: update documentation to describe minor fault handling

On Thu, Feb 4, 2021 at 11:57 AM Randy Dunlap <[email protected]> wrote:
>
> Hi Axel-
>
> one typo found:
>
> On 2/4/21 10:34 AM, Axel Rasmussen wrote:
> > Reword / reorganize things a little bit into "lists", so new features /
> > modes / ioctls can sort of just be appended.
>
> Good plan.
>
> >
> > Signed-off-by: Axel Rasmussen <[email protected]>
> > ---
> > Documentation/admin-guide/mm/userfaultfd.rst | 107 ++++++++++++-------
> > 1 file changed, 66 insertions(+), 41 deletions(-)
> >
> > diff --git a/Documentation/admin-guide/mm/userfaultfd.rst b/Documentation/admin-guide/mm/userfaultfd.rst
> > index 65eefa66c0ba..cfd3daf59d0e 100644
> > --- a/Documentation/admin-guide/mm/userfaultfd.rst
> > +++ b/Documentation/admin-guide/mm/userfaultfd.rst
>
> [snip]
>
> > -
> > -Once the ``userfaultfd`` has been enabled the ``UFFDIO_REGISTER`` ioctl should
> > -be invoked (if present in the returned ``uffdio_api.ioctls`` bitmask) to
> > -register a memory range in the ``userfaultfd`` by setting the
> > +events, except page fault notifications, may be generated:
> > +
> > +- The ``UFFD_FEATURE_EVENT_*`` flags indicate that various other events
> > + other than page faults are supported. These events are described in more
> > + detail below in the `Non-cooperative userfaultfd`_ section.
> > +
> > +- ``UFFD_FEATURE_MISSING_HUGETLBFS`` and ``UFFD_FEATURE_MISSING_SHMEM``
> > + indicate that the kernel supports ``UFFDIO_REGISTER_MODE_MISSING``
> > + registrations for hugetlbfs and shared memory (covering all shmem APIs,
> > + i.e. tmpfs, ``IPCSHM``, ``/dev/zero``, ``MAP_SHARED``, ``memfd_create``,
> > + etc) virtual memory areas, respectively.
> > +
> > +- ``UFFD_FEATURE_MINOR_HUGETLBFS`` indicates that the kernel supports
> > + ``UFFDIO_REGISTER_MODE_MINOR`` registration for hugetlbfs virtual memory
> > + areas.
> > +
> > +The userland application should set the feature flags it intends to use
>
> (ah, userspace has moved to userland temporarily. :)

For better or worse, other parts of the document I'm not touching also
use this wording. Maybe we should s/userland/userspace/g, but perhaps
better done as a separate commit to keep this diff focused?
Anecdotally, the use of "userland" doesn't seem to be completely
unprecedented (e.g. grep -r "userland" | wc -l yields 566 matches in
the kernel tree).

I don't have strong feelings, and I was amused by picturing some
Shire-esque countryside with a friendly sign that reads: ~userland
welcomes you~. :)

>
> > +when envoking the ``UFFDIO_API`` ioctl, to request that those features be
>
> invoking

Whoops! Will send a new version with this fix. Thanks!

>
> > +enabled if supported.
>
>
> thanks.
> --
> ~Randy
>

2021-02-04 21:09:56

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH v4 09/10] userfaultfd: update documentation to describe minor fault handling

On 2/4/21 1:04 PM, Axel Rasmussen wrote:
> On Thu, Feb 4, 2021 at 11:57 AM Randy Dunlap <[email protected]> wrote:
>>
>> Hi Axel-
>>
>> one typo found:
>>
>> On 2/4/21 10:34 AM, Axel Rasmussen wrote:
>>> Reword / reorganize things a little bit into "lists", so new features /
>>> modes / ioctls can sort of just be appended.
>>
>> Good plan.
>>
>>>
>>> Signed-off-by: Axel Rasmussen <[email protected]>
>>> ---
>>> Documentation/admin-guide/mm/userfaultfd.rst | 107 ++++++++++++-------
>>> 1 file changed, 66 insertions(+), 41 deletions(-)
>>>
>>> diff --git a/Documentation/admin-guide/mm/userfaultfd.rst b/Documentation/admin-guide/mm/userfaultfd.rst
>>> index 65eefa66c0ba..cfd3daf59d0e 100644
>>> --- a/Documentation/admin-guide/mm/userfaultfd.rst
>>> +++ b/Documentation/admin-guide/mm/userfaultfd.rst
>>
>> [snip]
>>
>>> -
>>> -Once the ``userfaultfd`` has been enabled the ``UFFDIO_REGISTER`` ioctl should
>>> -be invoked (if present in the returned ``uffdio_api.ioctls`` bitmask) to
>>> -register a memory range in the ``userfaultfd`` by setting the
>>> +events, except page fault notifications, may be generated:
>>> +
>>> +- The ``UFFD_FEATURE_EVENT_*`` flags indicate that various other events
>>> + other than page faults are supported. These events are described in more
>>> + detail below in the `Non-cooperative userfaultfd`_ section.
>>> +
>>> +- ``UFFD_FEATURE_MISSING_HUGETLBFS`` and ``UFFD_FEATURE_MISSING_SHMEM``
>>> + indicate that the kernel supports ``UFFDIO_REGISTER_MODE_MISSING``
>>> + registrations for hugetlbfs and shared memory (covering all shmem APIs,
>>> + i.e. tmpfs, ``IPCSHM``, ``/dev/zero``, ``MAP_SHARED``, ``memfd_create``,
>>> + etc) virtual memory areas, respectively.
>>> +
>>> +- ``UFFD_FEATURE_MINOR_HUGETLBFS`` indicates that the kernel supports
>>> + ``UFFDIO_REGISTER_MODE_MINOR`` registration for hugetlbfs virtual memory
>>> + areas.
>>> +
>>> +The userland application should set the feature flags it intends to use
>>
>> (ah, userspace has moved to userland temporarily. :)
>
> For better or worse, other parts of the document I'm not touching also
> use this wording. Maybe we should s/userland/userspace/g, but perhaps
> better done as a separate commit to keep this diff focused?
> Anecdotally, the use of "userland" doesn't seem to be completely
> unprecedented (e.g. grep -r "userland" | wc -l yields 566 matches in
> the kernel tree).
>
> I don't have strong feelings, and I was amused by picturing some
> Shire-esque countryside with a friendly sign that reads: ~userland
> welcomes you~. :)

I'm OK with not changing it. Up to you.

--
~Randy