linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: xu xin <cgel.zte@gmail.com>
Cc: akpm@linux-foundation.org, corbet@lwn.net, bagasdotme@gmail.com,
	willy@infradead.org, hughd@google.com,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, xu xin <xu.xin16@zte.com.cn>,
	Xiaokai Ran <ran.xiaokai@zte.com.cn>,
	Yang Yang <yang.yang29@zte.com.cn>
Subject: Re: [PATCH v4 1/2] ksm: count allocated ksm rmap_items for each process
Date: Sun, 28 Aug 2022 21:42:00 +0300	[thread overview]
Message-ID: <Ywu2+OiL9oqohr1v@localhost.localdomain> (raw)
In-Reply-To: <20220824124615.223158-1-xu.xin16@zte.com.cn>

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?

  parent reply	other threads:[~2022-08-28 18:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 12:45 [PATCH v4 0/2] ksm: count allocated rmap_items and update documentation xu xin
2022-08-24 12:46 ` [PATCH v4 1/2] ksm: count allocated ksm rmap_items for each process xu xin
2022-08-24 12:58   ` Matthew Wilcox
2022-08-28 18:42   ` Alexey Dobriyan [this message]
2022-08-24 12:48 ` [PATCH v4 2/2] ksm: add profit monitoring documentation xu xin
2022-08-24 13:02   ` Bagas Sanjaya
2022-08-24 12:56 ` [PATCH v4 0/2] ksm: count allocated rmap_items and update documentation Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ywu2+OiL9oqohr1v@localhost.localdomain \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bagasdotme@gmail.com \
    --cc=cgel.zte@gmail.com \
    --cc=corbet@lwn.net \
    --cc=hughd@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ran.xiaokai@zte.com.cn \
    --cc=willy@infradead.org \
    --cc=xu.xin16@zte.com.cn \
    --cc=yang.yang29@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).