lkml.org 
[lkml]   [2022]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [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?

\
 
 \ /
  Last update: 2022-08-28 21:56    [W:0.284 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site