lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230706094917.588213-1-sunnanyong@huawei.com>
Date:   Thu, 6 Jul 2023 17:49:17 +0800
From:   Nanyong Sun <sunnanyong@...wei.com>
To:     <akpm@...ux-foundation.org>
CC:     <xu.xin16@....com.cn>, <david@...hat.com>,
        <wangkefeng.wang@...wei.com>, <linux-kernel@...r.kernel.org>,
        <linux-mm@...ck.org>, <sunnanyong@...wei.com>
Subject: [PATCH] mm/ksm: prepare to remove the redundant ksm_merging_pages in procfs

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ