Messages in this thread Patch in this message | | | Date | Sun, 28 Aug 2022 21:42:00 +0300 | From | Alexey Dobriyan <> | Subject | Re: [PATCH v4 1/2] ksm: count allocated ksm rmap_items for each process |
| |
On Wed, Aug 24, 2022 at 12:46:15PM +0000, xu xin wrote: > +static int proc_pid_ksm_rmp_items(struct seq_file *m, struct pid_namespace *ns, > + struct pid *pid, struct task_struct *task) > +{ > + struct mm_struct *mm; > + > + mm = get_task_mm(task); > + if (mm) { > + seq_printf(m, "%lu\n", mm->ksm_rmp_items); > + mmput(mm); > + } > + > + return 0; > +} > #endif /* CONFIG_KSM */ > > #ifdef CONFIG_STACKLEAK_METRICS > @@ -3334,6 +3347,7 @@ static const struct pid_entry tgid_base_stuff[] = { > #endif > #ifdef CONFIG_KSM > ONE("ksm_merging_pages", S_IRUSR, proc_pid_ksm_merging_pages), > + ONE("ksm_rmp_items", S_IRUSR, proc_pid_ksm_rmp_items), > #endif
Another tiny /proc/$pid/ file?
Guys, this problem with "find /proc" instantiating megabytes is not getting better only worse.
How did KSM didn't get its own /proc/*/ksm file with many values?
Maybe add /proc/*/ksm and start filling it with stuff leaving /proc/*/ksm_merging_pages alone?
| |