2019-05-14 13:18:54

by Oleksandr Natalenko

[permalink] [raw]
Subject: [PATCH RFC v2 4/4] mm/ksm: add force merging/unmerging documentation

Document respective sysfs knob.

Signed-off-by: Oleksandr Natalenko <[email protected]>
---
Documentation/admin-guide/mm/ksm.rst | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
index 9303786632d1..4302b92910ec 100644
--- a/Documentation/admin-guide/mm/ksm.rst
+++ b/Documentation/admin-guide/mm/ksm.rst
@@ -78,6 +78,17 @@ KSM daemon sysfs interface
The KSM daemon is controlled by sysfs files in ``/sys/kernel/mm/ksm/``,
readable by all but writable only by root:

+force_madvise
+ write-only control to force merging/unmerging for specific
+ task.
+
+ To mark the VMAs as mergeable, use:
+ ``echo PID > /sys/kernel/mm/ksm/force_madvise``
+
+ To unmerge all the VMAs, use:
+ ``echo -PID > /sys/kernel/mm/ksm/force_madvise``
+ (note the prepending "minus")
+
pages_to_scan
how many pages to scan before ksmd goes to sleep
e.g. ``echo 100 > /sys/kernel/mm/ksm/pages_to_scan``.
--
2.21.0


2019-05-15 00:55:53

by Timofey Titovets

[permalink] [raw]
Subject: Re: [PATCH RFC v2 4/4] mm/ksm: add force merging/unmerging documentation

LGTM for whole series

Reviewed-by: Timofey Titovets <[email protected]>

вт, 14 мая 2019 г. в 16:17, Oleksandr Natalenko <[email protected]>:
>
> Document respective sysfs knob.
>
> Signed-off-by: Oleksandr Natalenko <[email protected]>
> ---
> Documentation/admin-guide/mm/ksm.rst | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
> index 9303786632d1..4302b92910ec 100644
> --- a/Documentation/admin-guide/mm/ksm.rst
> +++ b/Documentation/admin-guide/mm/ksm.rst
> @@ -78,6 +78,17 @@ KSM daemon sysfs interface
> The KSM daemon is controlled by sysfs files in ``/sys/kernel/mm/ksm/``,
> readable by all but writable only by root:
>
> +force_madvise
> + write-only control to force merging/unmerging for specific
> + task.
> +
> + To mark the VMAs as mergeable, use:
> + ``echo PID > /sys/kernel/mm/ksm/force_madvise``
> +
> + To unmerge all the VMAs, use:
> + ``echo -PID > /sys/kernel/mm/ksm/force_madvise``
> + (note the prepending "minus")
> +
In patch 3/4 you have special case with PID 0,
may be that also must be documented here?

> pages_to_scan
> how many pages to scan before ksmd goes to sleep
> e.g. ``echo 100 > /sys/kernel/mm/ksm/pages_to_scan``.
> --
> 2.21.0
>


--
Have a nice day,
Timofey.

2019-05-15 06:28:02

by Oleksandr Natalenko

[permalink] [raw]
Subject: Re: [PATCH RFC v2 4/4] mm/ksm: add force merging/unmerging documentation

Hi.

On Wed, May 15, 2019 at 03:53:55AM +0300, Timofey Titovets wrote:
> LGTM for whole series
>
> Reviewed-by: Timofey Titovets <[email protected]>
>
> вт, 14 мая 2019 г. в 16:17, Oleksandr Natalenko <[email protected]>:
> >
> > Document respective sysfs knob.
> >
> > Signed-off-by: Oleksandr Natalenko <[email protected]>
> > ---
> > Documentation/admin-guide/mm/ksm.rst | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
> > index 9303786632d1..4302b92910ec 100644
> > --- a/Documentation/admin-guide/mm/ksm.rst
> > +++ b/Documentation/admin-guide/mm/ksm.rst
> > @@ -78,6 +78,17 @@ KSM daemon sysfs interface
> > The KSM daemon is controlled by sysfs files in ``/sys/kernel/mm/ksm/``,
> > readable by all but writable only by root:
> >
> > +force_madvise
> > + write-only control to force merging/unmerging for specific
> > + task.
> > +
> > + To mark the VMAs as mergeable, use:
> > + ``echo PID > /sys/kernel/mm/ksm/force_madvise``
> > +
> > + To unmerge all the VMAs, use:
> > + ``echo -PID > /sys/kernel/mm/ksm/force_madvise``
> > + (note the prepending "minus")
> > +
> In patch 3/4 you have special case with PID 0,
> may be that also must be documented here?

Thanks for the review. Yes, this is a valid point, I'll document it too.

>
> > pages_to_scan
> > how many pages to scan before ksmd goes to sleep
> > e.g. ``echo 100 > /sys/kernel/mm/ksm/pages_to_scan``.
> > --
> > 2.21.0
> >
>
>
> --
> Have a nice day,
> Timofey.

--
Best regards,
Oleksandr Natalenko (post-factum)
Senior Software Maintenance Engineer