From patchwork Fri Feb 10 21:50:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roesch X-Patchwork-Id: 13136514 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC825C636D7 for ; Fri, 10 Feb 2023 21:57:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B727328001E; Fri, 10 Feb 2023 16:57:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A0EC4280023; Fri, 10 Feb 2023 16:57:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 79F1E280021; Fri, 10 Feb 2023 16:57:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5F0CC28001E for ; Fri, 10 Feb 2023 16:57:51 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 33F5D1A05F6 for ; Fri, 10 Feb 2023 21:57:51 +0000 (UTC) X-FDA: 80452745142.05.5718F24 Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by imf08.hostedemail.com (Postfix) with ESMTP id 8DCA4160015 for ; Fri, 10 Feb 2023 21:57:49 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=none; spf=neutral (imf08.hostedemail.com: 66.220.144.178 is neither permitted nor denied by domain of shr@devkernel.io) smtp.mailfrom=shr@devkernel.io ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676066269; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8hIhmYmoyvXJfCY+787/qNEg0vVbqxyyc+jduo0tMNc=; b=nL8Kk1sl5fYkrwtrtiuSzcocWsN50iJ74oz83WNqyRp38ryVN0E+oCUqR/YR+BHOESIIgB npHuhVJeRQ9RsuqE1RdLo+ZN72z/NeLLza7NAIC18G0FsFPTyY2Ww2XC2G5U1qU9DTGXNa iUCoaPFgspFm2jeWSGBn4qOMGtj6h1Q= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=none; spf=neutral (imf08.hostedemail.com: 66.220.144.178 is neither permitted nor denied by domain of shr@devkernel.io) smtp.mailfrom=shr@devkernel.io ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676066269; a=rsa-sha256; cv=none; b=SclgGDfRywWIQeeRZWUtSbKi+x5R+wSBNjnP0Nj9BASJhblpc+jho8mYw85nt4PE1MeA6w 4giHxfTsUPHvS5aJ45SqaQvEtutU5MSoFeFaxND03LzXPqMRjAuJglGImWFcxyg86s+Fbm aw0xe4xz9eIYxY9/1QQzLlF/B3jT9O4= Received: by dev0134.prn3.facebook.com (Postfix, from userid 425415) id 9A29F6BFC2E1; Fri, 10 Feb 2023 13:50:33 -0800 (PST) From: Stefan Roesch To: kernel-team@fb.com Cc: shr@devkernel.io, linux-mm@kvack.org, riel@surriel.com, mhocko@suse.com, david@redhat.com, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, akpm@linux-foundation.org Subject: [RFC PATCH v2 13/19] mm: expose ksm merge type in ksm_stat Date: Fri, 10 Feb 2023 13:50:17 -0800 Message-Id: <20230210215023.2740545-14-shr@devkernel.io> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230210215023.2740545-1-shr@devkernel.io> References: <20230210215023.2740545-1-shr@devkernel.io> MIME-Version: 1.0 X-Rspamd-Queue-Id: 8DCA4160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Ud2ucXm+x4c4XhFPIas1qlEA1ewa9ch1mzE8avgbQ8B+K7Mkfnlq50bAIQGzKwe1n3E+r/wokBSDoYvbDo9k/zAedciXFc/0aIRf X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 fb9567bc42a4..45749051e53b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -3200,6 +3200,7 @@ static int proc_pid_ksm_merging_pages(struct seq_file *m, struct pid_namespace * return 0; } + static int proc_pid_ksm_stat(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { @@ -3210,6 +3211,7 @@ static int proc_pid_ksm_stat(struct seq_file *m, struct pid_namespace *ns, seq_printf(m, "ksm_rmap_items %lu\n", mm->ksm_rmap_items); seq_printf(m, "zero_pages_sharing %lu\n", mm->ksm_zero_pages_sharing); 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); }