Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FF09C25B50 for ; Mon, 23 Jan 2023 18:06:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233819AbjAWSGb (ORCPT ); Mon, 23 Jan 2023 13:06:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233797AbjAWSGY (ORCPT ); Mon, 23 Jan 2023 13:06:24 -0500 Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5B60305DC for ; Mon, 23 Jan 2023 10:06:08 -0800 (PST) Received: by dev0134.prn3.facebook.com (Postfix, from userid 425415) id 76E965616BED; Mon, 23 Jan 2023 09:37:56 -0800 (PST) From: Stefan Roesch To: linux-mm@kvack.org Cc: shr@devkernel.io, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [RESEND RFC PATCH v1 14/20] mm: expose ksm merge type in ksm_stat Date: Mon, 23 Jan 2023 09:37:42 -0800 Message-Id: <20230123173748.1734238-15-shr@devkernel.io> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230123173748.1734238-1-shr@devkernel.io> References: <20230123173748.1734238-1-shr@devkernel.io> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This exposes the ksm process type in /proc//ksm_stat. The name of the value is ksm_merge_type. Signed-off-by: Stefan Roesch --- fs/proc/base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/proc/base.c b/fs/proc/base.c index a2b7779f76f6..2b63a70fb7a6 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -3200,6 +3200,7 @@ static int proc_pid_ksm_merging_pages(struct seq_fi= le *m, struct pid_namespace * =20 return 0; } + static int proc_pid_ksm_stat(struct seq_file *m, struct pid_namespace *n= s, struct pid *pid, struct task_struct *task) { @@ -3209,6 +3210,7 @@ static int proc_pid_ksm_stat(struct seq_file *m, st= ruct pid_namespace *ns, if (mm) { seq_printf(m, "ksm_rmap_items %lu\n", mm->ksm_rmap_items); seq_printf(m, "ksm_merging_pages %lu\n", mm->ksm_merging_pages); + seq_printf(m, "ksm_merge_type %s\n", ksm_merge_type(mm)); seq_printf(m, "ksm_process_profit %ld\n", ksm_process_profit(mm)); mmput(mm); } --=20 2.30.2