[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Ywu2+OiL9oqohr1v@localhost.localdomain>
Date: Sun, 28 Aug 2022 21:42:00 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: xu xin <cgel.zte@...il.com>
Cc: akpm@...ux-foundation.org, corbet@....net, bagasdotme@...il.com,
willy@...radead.org, hughd@...gle.com,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, xu xin <xu.xin16@....com.cn>,
Xiaokai Ran <ran.xiaokai@....com.cn>,
Yang Yang <yang.yang29@....com.cn>
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?
Powered by blists - more mailing lists