diff mbox series

[RFC,v2,14/19] docs: document new procfs ksm knobs

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

Commit Message

Stefan Roesch Feb. 10, 2023, 9:50 p.m. UTC
Document both ksm_process_profit and ksm_merge_type proc settings.

Signed-off-by: Stefan Roesch <shr@devkernel.io>
Reviewed-By: Bagas Sanjaya <bagasdotme@gmail.com>
---
 Documentation/admin-guide/mm/ksm.rst | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Bagas Sanjaya Feb. 11, 2023, 8:18 a.m. UTC | #1
On 2/11/23 04:50, Stefan Roesch wrote:
> diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
> index 5c4daf44d79d..34f1d0396eee 100644
> --- a/Documentation/admin-guide/mm/ksm.rst
> +++ b/Documentation/admin-guide/mm/ksm.rst
> @@ -218,7 +218,8 @@ several times, which are unprofitable memory consumed.
>  			  ksm_rmap_items * sizeof(rmap_item).
>  
>     where ksm_merging_pages is shown under the directory ``/proc/<pid>/``,
> -   and ksm_rmap_items is shown in ``/proc/<pid>/ksm_stat``.
> +   and ksm_rmap_items is shown in ``/proc/<pid>/ksm_stat``. The process profit
> +   is also shown in ``/proc/<pid>/ksm_stat`` as ksm_process_profit.
>  
>  From the perspective of application, a high ratio of ``ksm_rmap_items`` to
>  ``ksm_merging_pages`` means a bad madvise-applied policy, so developers or
> @@ -229,6 +230,9 @@ so if the ``ksm_rmap_items/ksm_merging_pages`` ratio exceeds 64 on 64-bit CPU
>  or exceeds 128 on 32-bit CPU, then the app's madvise policy should be dropped,
>  because the ksm profit is approximately zero or negative.
>  
> +The ksm_merge_type in ``/proc/<pid>/ksm_stat`` shows the merge type of the
> +process. Valid values are ``none``, ``madvise`` and ``process``.
> +
>  Monitoring KSM events
>  =====================
>  

LGTM, thanks!

Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
diff mbox series

Patch

diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
index 5c4daf44d79d..34f1d0396eee 100644
--- a/Documentation/admin-guide/mm/ksm.rst
+++ b/Documentation/admin-guide/mm/ksm.rst
@@ -218,7 +218,8 @@  several times, which are unprofitable memory consumed.
 			  ksm_rmap_items * sizeof(rmap_item).
 
    where ksm_merging_pages is shown under the directory ``/proc/<pid>/``,
-   and ksm_rmap_items is shown in ``/proc/<pid>/ksm_stat``.
+   and ksm_rmap_items is shown in ``/proc/<pid>/ksm_stat``. The process profit
+   is also shown in ``/proc/<pid>/ksm_stat`` as ksm_process_profit.
 
 From the perspective of application, a high ratio of ``ksm_rmap_items`` to
 ``ksm_merging_pages`` means a bad madvise-applied policy, so developers or
@@ -229,6 +230,9 @@  so if the ``ksm_rmap_items/ksm_merging_pages`` ratio exceeds 64 on 64-bit CPU
 or exceeds 128 on 32-bit CPU, then the app's madvise policy should be dropped,
 because the ksm profit is approximately zero or negative.
 
+The ksm_merge_type in ``/proc/<pid>/ksm_stat`` shows the merge type of the
+process. Valid values are ``none``, ``madvise`` and ``process``.
+
 Monitoring KSM events
 =====================