Thread (31 messages) 31 messages, 7 authors, 2023-01-30
STALE1243d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[RESEND RFC PATCH v1 15/20] docs: document new procfs ksm knobs

From: Stefan Roesch <hidden>
Date: 2023-01-23 17:58:31
Also in: linux-doc, linux-fsdevel, linux-kselftest, linux-mm, lkml
Subsystem: documentation, memory management - ksm (kernel samepage merging), memory management - misc, the rest · Maintainers: Jonathan Corbet, Andrew Morton, David Hildenbrand, Linus Torvalds

This documents the ksm_process_profit and ksm_merge_type settings in
ksm_stat.

Signed-off-by: Stefan Roesch <redacted>
---
 Documentation/admin-guide/mm/ksm.rst | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
index 72189bf1283e..70896f01d641 100644
--- a/Documentation/admin-guide/mm/ksm.rst
+++ b/Documentation/admin-guide/mm/ksm.rst
@@ -211,7 +211,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
@@ -222,6 +223,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
 =====================
 
-- 
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help