From patchwork Fri Feb 10 21:50:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roesch X-Patchwork-Id: 13136515 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 76C3FC64ED9 for ; Fri, 10 Feb 2023 21:57:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E959280024; Fri, 10 Feb 2023 16:57:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 09955280021; Fri, 10 Feb 2023 16:57:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA2AF280024; Fri, 10 Feb 2023 16:57:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id CEA53280021 for ; Fri, 10 Feb 2023 16:57:56 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A61191C6191 for ; Fri, 10 Feb 2023 21:57:56 +0000 (UTC) X-FDA: 80452745352.06.95F90B2 Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by imf05.hostedemail.com (Postfix) with ESMTP id 0D2EC100004 for ; Fri, 10 Feb 2023 21:57:54 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=none; spf=neutral (imf05.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=1676066275; 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=sqqwEo3HJ9745cc6ZGRbD2GEHTwsqkH5y3UC7Zft/Hg=; b=ka3ryXkwxrpzLYUByCPatnqRerDhbrPnnx09xkwaXk1d6b2lJdp5fTIgQ6mxZzXB7axPcV V3Abq0fpY7U5SId8RNTiy1aNmb7/z8AfbOPn7p9W8c+3ar/fti9A+RPm9IwqS50ODzs8ku 5bWw0KbaF8WKDRYmBBSeqx82YNxzVX4= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=none; spf=neutral (imf05.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=1676066275; a=rsa-sha256; cv=none; b=W2i73Nhj6jnjZKes0zijFx2j5WDNsq5M/LJOi4jIhrX3M0HTLBz2Tsx9jJEsG4YhDKksuj XqSmyF9AlKLfEbi80x8GT3uhxSEz18fDKeJFrC7Le3bEDjnVxERQJzfH0cN/7cl1sLXUnM PVzSbCEkwdGxJd2TNvHdaaW265++gxw= Received: by dev0134.prn3.facebook.com (Postfix, from userid 425415) id 9EAD76BFC2E3; 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, Bagas Sanjaya Subject: [RFC PATCH v2 14/19] docs: document new procfs ksm knobs Date: Fri, 10 Feb 2023 13:50:18 -0800 Message-Id: <20230210215023.2740545-15-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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 0D2EC100004 X-Stat-Signature: uwkitsmyabtxwkifsum1jswmjrf1i7gg X-HE-Tag: 1676066274-581832 X-HE-Meta: U2FsdGVkX18VJ21KavaktjvMOCLICHFuh96WDZF5cab9PNzj29Xy0lI5LQBCxpc6Svh1w0QtBwet0OCCHJN2xLXWgH2OxdLiDH6zzPYerVvnAssKfBVYCRmVbStbZloaQ/Ol9NDZoil6XA4uyJU72yCt+FRDyQEvszit/pJmUERCS9cFfLxi6s5iIAxqxX6Z7YZVdjJbc6W6kMfaRsvOirzWqpnbkahHF6DSeo0T2DJcFGQoqpwbLG2Z1z2ZSgk/NM+TXTOccApthnohxv5slVg2O9gAZfHCtybr2DTrbQKg/A43od/mfy+jNKJayO73xgLJ1b4L9cXI650r4pzSkT24pZ5aTwnO+ZWEZRGCNmggtEWKNFgQ+Q6MdWceMs59paNeyMWO92t9EKw3UL/FoJRzdmck7571OrOstsVVG2r3nJzK5itq7IgHKMJw2mItpafevytVbcxprfTzcCCOJRIlUlepBKWsWnEVP85zTtj5AmKN42ImOoVzMuTpjErLB9om0ZqjW2zqXIjsB7tz/A9QFCDRkI/7V4JPItXIhxHelThVqU68vMiHsBav351D5vIBOuiVTV/AiF28Ad91uuiTjmgNXdUN9WFGwmOgNPpaUBOpB/BFKwnHFF5QUp68fpN6OITN/R6WAluJmLPZA8UgCroqWy/1VWPlOfkauJhg/8dc3gq+CX7h8XpepGBPtqojgWkSeKpXMX8MA9VJ8jBoVLnn4RSbtt13zBk8wYs3jxjfjUigRPXjrlLk90S1llQfuEV0pee3LQcFslzcW70QDQGDxtqr5TK8voG+lZwfoGPjuYhDciLnEnxNFHdoSvUTCJ3rUDsXFmp3BsDIsImPd87tHnNHu3owcSr+lf5uzD5eDNa1P/7Ywi8tGHfqDhTzmXNJviOYSpb0JYPYGnoNI2bLxlaT2Tdzo2SjyjOaIqc6LiBzZHcpNqCXQwB5juPQv1fhXp/54zQIdEN Ox9MvjMo 7nuREhyGXYbr81Dtm/rwCXIZEz0HN37JoyzV67pY93o5n/wq5lW0PRSKCDrqiWkcJSuEmt0vb11Z9Q/Q= 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: Document both ksm_process_profit and ksm_merge_type proc settings. Signed-off-by: Stefan Roesch Reviewed-By: Bagas Sanjaya Reviewed-by: Bagas Sanjaya --- 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 5c4daf44d79d..34f1d0396eee 100644 --- a/Documentation/admin-guide/mm/ksm.rst +++ b/Documentation/admin-guide/mm/ksm.rst @@ -218,7 +218,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 @@ -229,6 +230,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 =====================