linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nanyong Sun <sunnanyong@huawei.com>
To: <akpm@linux-foundation.org>
Cc: <xu.xin16@zte.com.cn>, <david@redhat.com>,
	<wangkefeng.wang@huawei.com>, <linux-kernel@vger.kernel.org>,
	<linux-mm@kvack.org>, <sunnanyong@huawei.com>
Subject: [PATCH] mm/ksm: prepare to remove the redundant ksm_merging_pages in procfs
Date: Thu, 6 Jul 2023 17:49:17 +0800	[thread overview]
Message-ID: <20230706094917.588213-1-sunnanyong@huawei.com> (raw)

Since the ksm_merging_pages information already included in
/proc/<pid>/ksm_stat, we could remove /proc/<pid>/ksm_merging_pages
to make the directory more clean, and can save a little bit resources.

To delete this interface more smoothly and avoid userspace break,
retain this interface temporarily and modify its function to hint
users to use ksm_stat instead.

Signed-off-by: Nanyong Sun <sunnanyong@huawei.com>
---
 fs/proc/base.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index eb2e498e3b8d..d080c58cbe6c 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -3189,14 +3189,7 @@ static int proc_pid_patch_state(struct seq_file *m, struct pid_namespace *ns,
 static int proc_pid_ksm_merging_pages(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_merging_pages);
-		mmput(mm);
-	}
-
+	seq_puts(m, "please use /proc/<pid>/ksm_stat instead\n");
 	return 0;
 }
 static int proc_pid_ksm_stat(struct seq_file *m, struct pid_namespace *ns,
-- 
2.25.1



             reply	other threads:[~2023-07-06  8:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06  9:49 Nanyong Sun [this message]
2023-07-06  8:55 ` David Hildenbrand
2023-07-06 11:59   ` Nanyong Sun
2023-07-06 12:01     ` David Hildenbrand

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=20230706094917.588213-1-sunnanyong@huawei.com \
    --to=sunnanyong@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=wangkefeng.wang@huawei.com \
    --cc=xu.xin16@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