diff mbox series

[RESEND,RFC,v1,10/20] docs: document general_profit sysfs knob

Message ID 20230123173748.1734238-11-shr@devkernel.io (mailing list archive)
State New
Headers show
Series mm: process/cgroup ksm support | expand

Commit Message

Stefan Roesch Jan. 23, 2023, 5:37 p.m. UTC
This adds documentation for the new /sys/kernel/mm/ksm/general_profit
knob.

Signed-off-by: Stefan Roesch <shr@devkernel.io>
---
 Documentation/ABI/testing/sysfs-kernel-mm-ksm | 8 ++++++++
 Documentation/admin-guide/mm/ksm.rst          | 2 ++
 2 files changed, 10 insertions(+)

Comments

Bagas Sanjaya Jan. 24, 2023, 4:07 a.m. UTC | #1
On Mon, Jan 23, 2023 at 09:37:38AM -0800, Stefan Roesch wrote:
> This adds documentation for the new /sys/kernel/mm/ksm/general_profit
> knob.

"Document general_profit knob."

> 
> Signed-off-by: Stefan Roesch <shr@devkernel.io>
> ---
>  Documentation/ABI/testing/sysfs-kernel-mm-ksm | 8 ++++++++
>  Documentation/admin-guide/mm/ksm.rst          | 2 ++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-ksm b/Documentation/ABI/testing/sysfs-kernel-mm-ksm
> index d244674a9480..7768e90f7a8f 100644
> --- a/Documentation/ABI/testing/sysfs-kernel-mm-ksm
> +++ b/Documentation/ABI/testing/sysfs-kernel-mm-ksm
> @@ -51,3 +51,11 @@ Description:	Control merging pages across different NUMA nodes.
>  
>  		When it is set to 0 only pages from the same node are merged,
>  		otherwise pages from all nodes can be merged together (default).
> +
> +What:		/sys/kernel/mm/ksm/general_profit
> +Date:		January 2023
> +KernelVersion:  6.1
> +Contact:	Linux memory management mailing list <linux-mm@kvack.org>
> +Description:	Measure how effective KSM is.
> +		general_profit: how effective is KSM. The formula for the
> +		calculation is in Documentation/admin-guide/mm/ksm.rst.
> diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
> index fb6ba2002a4b..72189bf1283e 100644
> --- a/Documentation/admin-guide/mm/ksm.rst
> +++ b/Documentation/admin-guide/mm/ksm.rst
> @@ -159,6 +159,8 @@ stable_node_chains_prune_millisecs
>  
>  The effectiveness of KSM and MADV_MERGEABLE is shown in ``/sys/kernel/mm/ksm/``:
>  
> +general_profit
> +        how effective is KSM. The calculation is explained below.
>  pages_shared
>          how many shared pages are being used
>  pages_sharing

Seems like the wording is confusing me, so I write the improv:

---- >8 ----
diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-ksm b/Documentation/ABI/testing/sysfs-kernel-mm-ksm
index 7768e90f7a8fef..5309a912ab679b 100644
--- a/Documentation/ABI/testing/sysfs-kernel-mm-ksm
+++ b/Documentation/ABI/testing/sysfs-kernel-mm-ksm
@@ -56,6 +56,6 @@ What:		/sys/kernel/mm/ksm/general_profit
 Date:		January 2023
 KernelVersion:  6.1
 Contact:	Linux memory management mailing list <linux-mm@kvack.org>
-Description:	Measure how effective KSM is.
-		general_profit: how effective is KSM. The formula for the
-		calculation is in Documentation/admin-guide/mm/ksm.rst.
+Description:	Measure the KSM profit. See
+		:ref:`KSM documentation <monitoring-ksm-profit>` for details
+		on the calculated formula.
diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
index 70896f01d64106..fb67318aab1ba2 100644
--- a/Documentation/admin-guide/mm/ksm.rst
+++ b/Documentation/admin-guide/mm/ksm.rst
@@ -160,7 +160,8 @@ stable_node_chains_prune_millisecs
 The effectiveness of KSM and MADV_MERGEABLE is shown in ``/sys/kernel/mm/ksm/``:
 
 general_profit
-        how effective is KSM. The calculation is explained below.
+        the KSM profit. The calculation is described :ref:`below
+        <monitoring-ksm-profit>`.
 pages_shared
         how many shared pages are being used
 pages_sharing
@@ -186,6 +187,8 @@ The maximum possible ``pages_sharing/pages_shared`` ratio is limited by the
 ``max_page_sharing`` tunable. To increase the ratio ``max_page_sharing`` must
 be increased accordingly.
 
+.. _monitoring-ksm-profit:
+
 Monitoring KSM profit
 =====================
 
Thanks.
Jonathan Corbet Jan. 24, 2023, 4:21 p.m. UTC | #2
Bagas Sanjaya <bagasdotme@gmail.com> writes:

> Seems like the wording is confusing me, so I write the improv:
>
> ---- >8 ----
> diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-ksm b/Documentation/ABI/testing/sysfs-kernel-mm-ksm
> index 7768e90f7a8fef..5309a912ab679b 100644
> --- a/Documentation/ABI/testing/sysfs-kernel-mm-ksm
> +++ b/Documentation/ABI/testing/sysfs-kernel-mm-ksm
> @@ -56,6 +56,6 @@ What:		/sys/kernel/mm/ksm/general_profit
>  Date:		January 2023
>  KernelVersion:  6.1
>  Contact:	Linux memory management mailing list <linux-mm@kvack.org>
> -Description:	Measure how effective KSM is.
> -		general_profit: how effective is KSM. The formula for the
> -		calculation is in Documentation/admin-guide/mm/ksm.rst.
> +Description:	Measure the KSM profit. See
> +		:ref:`KSM documentation <monitoring-ksm-profit>` for details
> +		on the calculated formula.

So the original at least attempted to tell us what "KSM profit" is; the
"improved" version makes no such effort.  I don't think that is actually
better.

jon
Bagas Sanjaya Jan. 26, 2023, 2:31 a.m. UTC | #3
On Tue, Jan 24, 2023 at 09:21:51AM -0700, Jonathan Corbet wrote:
> Bagas Sanjaya <bagasdotme@gmail.com> writes:
> 
> > Seems like the wording is confusing me, so I write the improv:
> >
> > ---- >8 ----
> > diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-ksm b/Documentation/ABI/testing/sysfs-kernel-mm-ksm
> > index 7768e90f7a8fef..5309a912ab679b 100644
> > --- a/Documentation/ABI/testing/sysfs-kernel-mm-ksm
> > +++ b/Documentation/ABI/testing/sysfs-kernel-mm-ksm
> > @@ -56,6 +56,6 @@ What:		/sys/kernel/mm/ksm/general_profit
> >  Date:		January 2023
> >  KernelVersion:  6.1
> >  Contact:	Linux memory management mailing list <linux-mm@kvack.org>
> > -Description:	Measure how effective KSM is.
> > -		general_profit: how effective is KSM. The formula for the
> > -		calculation is in Documentation/admin-guide/mm/ksm.rst.
> > +Description:	Measure the KSM profit. See
> > +		:ref:`KSM documentation <monitoring-ksm-profit>` for details
> > +		on the calculated formula.
> 
> So the original at least attempted to tell us what "KSM profit" is; the
> "improved" version makes no such effort.  I don't think that is actually
> better.

I overlooked that, thanks!
diff mbox series

Patch

diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-ksm b/Documentation/ABI/testing/sysfs-kernel-mm-ksm
index d244674a9480..7768e90f7a8f 100644
--- a/Documentation/ABI/testing/sysfs-kernel-mm-ksm
+++ b/Documentation/ABI/testing/sysfs-kernel-mm-ksm
@@ -51,3 +51,11 @@  Description:	Control merging pages across different NUMA nodes.
 
 		When it is set to 0 only pages from the same node are merged,
 		otherwise pages from all nodes can be merged together (default).
+
+What:		/sys/kernel/mm/ksm/general_profit
+Date:		January 2023
+KernelVersion:  6.1
+Contact:	Linux memory management mailing list <linux-mm@kvack.org>
+Description:	Measure how effective KSM is.
+		general_profit: how effective is KSM. The formula for the
+		calculation is in Documentation/admin-guide/mm/ksm.rst.
diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
index fb6ba2002a4b..72189bf1283e 100644
--- a/Documentation/admin-guide/mm/ksm.rst
+++ b/Documentation/admin-guide/mm/ksm.rst
@@ -159,6 +159,8 @@  stable_node_chains_prune_millisecs
 
 The effectiveness of KSM and MADV_MERGEABLE is shown in ``/sys/kernel/mm/ksm/``:
 
+general_profit
+        how effective is KSM. The calculation is explained below.
 pages_shared
         how many shared pages are being used
 pages_sharing