This exposes the ksm process type in /proc/<pid>/ksm_stat. The name of the value is ksm_merge_type.
Signed-off-by: Stefan Roesch shr@devkernel.io --- fs/proc/base.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/fs/proc/base.c b/fs/proc/base.c index fb9567bc42a4..45749051e53b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -3200,6 +3200,7 @@ static int proc_pid_ksm_merging_pages(struct seq_file *m, struct pid_namespace *
return 0; } + static int proc_pid_ksm_stat(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { @@ -3210,6 +3211,7 @@ static int proc_pid_ksm_stat(struct seq_file *m, struct pid_namespace *ns, seq_printf(m, "ksm_rmap_items %lu\n", mm->ksm_rmap_items); seq_printf(m, "zero_pages_sharing %lu\n", mm->ksm_zero_pages_sharing); seq_printf(m, "ksm_merging_pages %lu\n", mm->ksm_merging_pages); + seq_printf(m, "ksm_merge_type %s\n", ksm_merge_type(mm)); seq_printf(m, "ksm_process_profit %ld\n", ksm_process_profit(mm)); mmput(mm); }