From patchwork Mon Jan 23 17:37:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roesch X-Patchwork-Id: 13112646 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 688A5C05027 for ; Mon, 23 Jan 2023 17:38:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F33596B008C; Mon, 23 Jan 2023 12:38:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EE2F06B0092; Mon, 23 Jan 2023 12:38:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D84026B0093; Mon, 23 Jan 2023 12:38:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id BB6B76B008C for ; Mon, 23 Jan 2023 12:38:33 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7E67BA1812 for ; Mon, 23 Jan 2023 17:38:33 +0000 (UTC) X-FDA: 80386773306.01.7A41DFA Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by imf09.hostedemail.com (Postfix) with ESMTP id D3059140021 for ; Mon, 23 Jan 2023 17:38:31 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=none; spf=neutral (imf09.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=1674495512; 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=48BaoTp/2HJ6bS79iL9g9GlQiiTNNuHFinc8DbFXwQM=; b=h6q5QPTPJ4q+cguJPGWl1BsZI4TzOMev52mjJPzttkzPI7JxSO8sOb2LNu5iIRgSVps2Cd tix6YMSz5h8n730jWviGMY0wZA6AM4+H8ag3dlc9cLJsamR+HPC1RyiwePBrlavTvCYMyJ wy9PSRUFdk4+8XZ17z4wIavQTe91h6c= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; dmarc=none; spf=neutral (imf09.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=1674495512; a=rsa-sha256; cv=none; b=HEBjywP9FNxY7U2FxguDTDAw25r3ErvYouCkn3RdaJ+OyvBzxUDbOSx92SSFG2OllLaW7z e6CwgnNlPSce4yvQAFM8H6BlaDCE9qZs/fZXvGDUDIZBXJJQzE/tbKt1pZE2kkwPSc5SY7 lUEJOPh5iT2vGGtinBfZa/7j5qrM8Ec= Received: by dev0134.prn3.facebook.com (Postfix, from userid 425415) id 7BBE85616BF1; 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 15/20] docs: document new procfs ksm knobs Date: Mon, 23 Jan 2023 09:37:43 -0800 Message-Id: <20230123173748.1734238-16-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-Rspamd-Queue-Id: D3059140021 X-Stat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z Wq80TQ8c yQ+AT7CgrD2I7F+EKA3OWNmKFCAspeeYEy0/GLP4Pu/nJcrI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This documents the ksm_process_profit and ksm_merge_type settings in ksm_stat. Signed-off-by: Stefan Roesch --- Documentation/admin-guide/mm/ksm.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst index 72189bf1283e..70896f01d641 100644 --- a/Documentation/admin-guide/mm/ksm.rst +++ b/Documentation/admin-guide/mm/ksm.rst @@ -211,7 +211,8 @@ several times, which are unprofitable memory consumed. ksm_rmap_items * sizeof(rmap_item). where ksm_merging_pages is shown under the directory ``/proc//``, - and ksm_rmap_items is shown in ``/proc//ksm_stat``. + and ksm_rmap_items is shown in ``/proc//ksm_stat``. The process profit + is also shown in ``/proc//ksm_stat`` as ksm_process_profit. From the perspective of application, a high ratio of ``ksm_rmap_items`` to ``ksm_merging_pages`` means a bad madvise-applied policy, so developers or @@ -222,6 +223,9 @@ so if the ``ksm_rmap_items/ksm_merging_pages`` ratio exceeds 64 on 64-bit CPU or exceeds 128 on 32-bit CPU, then the app's madvise policy should be dropped, because the ksm profit is approximately zero or negative. +The ksm_merge_type in ``/proc//ksm_stat`` shows the merge type of the +process. Valid values are ``none``, ``madvise`` and ``process``. + Monitoring KSM events =====================