From patchwork Mon Jan 23 17:37:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roesch X-Patchwork-Id: 13112649 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 89235C05027 for ; Mon, 23 Jan 2023 17:38:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A4116B007B; Mon, 23 Jan 2023 12:38:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8552D6B0096; Mon, 23 Jan 2023 12:38:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 67E5F6B0095; Mon, 23 Jan 2023 12:38:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 58CA76B007B for ; Mon, 23 Jan 2023 12:38:41 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2EFC2C0829 for ; Mon, 23 Jan 2023 17:38:41 +0000 (UTC) X-FDA: 80386773642.22.83A60FF Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by imf01.hostedemail.com (Postfix) with ESMTP id 719BB4001C for ; Mon, 23 Jan 2023 17:38:39 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=none; spf=neutral (imf01.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=1674495519; 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=M9n46KmmTPQMjnZG+W9yInSyzHIuWxq53EhKeS5hBuA=; b=AaYsXi7cNbHsDnhHgLgTX+9/1i0FHYhJl1e5B4b/TQYN2qgy6dttRSnOsIYw3BQov6fTnx PLn75biNRK40b+yO509myKZavykolw7rtxDN2Edk9ALJNdltQUgOf1uJ/OKaBkflwT9oBF 5MHwljt5id+HENxHubavN/BaUg+SNpw= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=none; spf=neutral (imf01.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=1674495519; a=rsa-sha256; cv=none; b=r/Eqv3gT5yjXrG3EKqXJvWD9zNUfiRcCGqZcHIagHY7jkkonMvxtDuyt0D95olCMFQhNR+ 4CZ+kzdVGF0i2SFC+BxRcZr50qzBB6WXTpINfctRstmC9avkWOyuLdjZiu8z+D91oSPz0Y 8q6Zqi2XPuSbNukXqPe2IBrlrKLIKbk= 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 X-Rspam-User: X-Rspamd-Server: rspam02 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SfsTZuJvwZsgIcil3MmG46x1+mNfayOEnUK+DNPD2+cH1UiL2zOkD+37zKslABR4Kv8Uak7gN8vvMArGMBA5QF1 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 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_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) { @@ -3209,6 +3210,7 @@ static int proc_pid_ksm_stat(struct seq_file *m, struct 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); }