From patchwork Thu Sep 29 03:00:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xu xin X-Patchwork-Id: 12993458 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 37546C32771 for ; Thu, 29 Sep 2022 03:00:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D414F8D0002; Wed, 28 Sep 2022 23:00:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF0E68D0001; Wed, 28 Sep 2022 23:00:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B90F48D0002; Wed, 28 Sep 2022 23:00:50 -0400 (EDT) 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 A9F6F8D0001 for ; Wed, 28 Sep 2022 23:00:50 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 83CF21A0E56 for ; Thu, 29 Sep 2022 03:00:50 +0000 (UTC) X-FDA: 79963620660.25.B868FCB Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by imf17.hostedemail.com (Postfix) with ESMTP id EDA624000C for ; Thu, 29 Sep 2022 03:00:49 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id 129so272664pgc.5 for ; Wed, 28 Sep 2022 20:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=ntOaXZWiOy5WNqk09ZQlodKiEJfpbZTIA6gGynxCZgg=; b=lDrpHaRe9q0Jmc73SFbCt9ppSUFzUBZQytKKBHRnGVV6W/U/oV4Z6GbzD1WrZHU3iY Dr9lNNGskr562NpUqNyd2bNs38c0ulNiZHQQZGKaavIWzwERXtZxC4E3uyYW1tvmXOl1 BIJu9o9fHpLCLew11QwcghxIlKe0yu83YBxNyq6N2yTvqSVnbJ+gHBa4ri8bx0eRYZxp Vz2FXybaTYpHWayU4lYC2sx1qtTfJPzaskE9v7Mu63T8SFCwsaSk8vIm02cQ1iIG/d12 at9swJiwgngFuWqopH33bZTiGhCecnkfLXOIvFBeuwP29OT+s+eNmZgyMOo1VGlczpjR hq9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=ntOaXZWiOy5WNqk09ZQlodKiEJfpbZTIA6gGynxCZgg=; b=r2NyEX6c4LP4dG9YVqP2IxRq5DJAlheAkFzcMqANx9l1GNwvEYm5aNGse3HfuvLeN/ 2PxCYXQP9BTFIpCJxS178qxjjwFyRJta7m8a5fqxgA4jTscEdVFNBjhwRwGXGuRrhnZc Ac+aiWdaVLHUvN2FP2eon6z+LtIOhEhsSyISG4oAHNVXOtFA0WlOjk+FfKasPpf0jKe8 HKmKCTV64Ur4RrB9Nlkft8NoJsf7+vZWm0AADOljOeTJyOdsHIO7VaVgQIGVzpQuXuMP amoxMTgJoOFwoaIxr3hDS19u9rT3ordi5VS5BZmHFV3Udlvt1rnxTSRLAKi6WvlJPidv dtsw== X-Gm-Message-State: ACrzQf36Iy1+GYJNcZMT03Mt4RodG8QR7BXaVBo0ubNMdq9JaqCI7qN0 b6e5yVtxSpnDE+kWEiJlFiKXKijQgrsgc3/o X-Google-Smtp-Source: AMsMyM7X5xSmzpChrAhbu30JbqsqVY23sNZy0Ud37cuhoijBt6sOMXtCgJ0t1uML1A5taGTx4lez7A== X-Received: by 2002:aa7:9532:0:b0:53e:7875:39e1 with SMTP id c18-20020aa79532000000b0053e787539e1mr1149275pfp.82.1664420448926; Wed, 28 Sep 2022 20:00:48 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id lb12-20020a17090b4a4c00b00205fafa6768sm1194675pjb.6.2022.09.28.20.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 20:00:48 -0700 (PDT) From: xu.xin.sc@gmail.com X-Google-Original-From: xu.xin16@zte.com.cn To: akpm@linux-foundation.org, david@redhat.com, imbrenda@linux.vnet.ibm.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, xu xin , Xiaokai Ran , Yang Yang , Jiang Xuexin , xu xin Subject: [PATCH 3/3] ksm: add zero_pages_sharing in Documentation Date: Thu, 29 Sep 2022 03:00:43 +0000 Message-Id: <20220929030043.281441-1-xu.xin16@zte.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025206.280970-1-xu.xin16@zte.com.cn> References: <20220929025206.280970-1-xu.xin16@zte.com.cn> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lDrpHaRe; spf=pass (imf17.hostedemail.com: domain of xu.xin.sc@gmail.com designates 209.85.215.193 as permitted sender) smtp.mailfrom=xu.xin.sc@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664420450; a=rsa-sha256; cv=none; b=q7gFmdDZs/tjKXu9nk9EeLWFBCvfz0F001pv05VbAujVkJIL4OYkCpG5GcLuVujND2TxTN L7T6Ov/hd7PvDpO1z0Z0TtxhNUaVSsvFA+WGi30BmrcIYtmHgJ/Cnpg3fBGmWAFWfacwMa KTQpPTsQ362z3vF89TG+FXiaLXdILeA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664420450; 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:dkim-signature; bh=ntOaXZWiOy5WNqk09ZQlodKiEJfpbZTIA6gGynxCZgg=; b=oAU1pgBO9SC+vjdlt41tqnTj36KQl9XNWu3hOwLVs4AXLjndxzov3leHJMOHOMFwR4ssV/ K4ITkO5H/f0dZBQ9bwVTwl4p/DeJ+lNT96HmbmAhhe79iNCtG61o+cKWngn4GeE755I7Ft +BpdEFXakTTmHimjCNX3/FS5foVPUnY= X-Stat-Signature: 3fcj1gwd6zz4k3umbeenezkecmandu7h X-Rspamd-Queue-Id: EDA624000C Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lDrpHaRe; spf=pass (imf17.hostedemail.com: domain of xu.xin.sc@gmail.com designates 209.85.215.193 as permitted sender) smtp.mailfrom=xu.xin.sc@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Rspamd-Server: rspam07 X-HE-Tag: 1664420449-796997 X-Bogosity: Ham, tests=bogofilter, spamicity=0.002342, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: xu xin When enabling use_zero_pages, pages_sharing cannot represent how much memory saved indeed. zero_pages_sharing + pages_sharing does. add the description of zero_pages_sharing. Signed-off-by: xu xin Cc: Xiaokai Ran Cc: Yang Yang Cc: Jiang Xuexin Signed-off-by: xu xin --- Documentation/admin-guide/mm/ksm.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst index fb6ba2002a4b..484665aa7418 100644 --- a/Documentation/admin-guide/mm/ksm.rst +++ b/Documentation/admin-guide/mm/ksm.rst @@ -162,7 +162,7 @@ The effectiveness of KSM and MADV_MERGEABLE is shown in ``/sys/kernel/mm/ksm/``: pages_shared how many shared pages are being used pages_sharing - how many more sites are sharing them i.e. how much saved + how many more sites are sharing them pages_unshared how many pages unique but repeatedly checked for merging pages_volatile @@ -173,6 +173,14 @@ stable_node_chains the number of KSM pages that hit the ``max_page_sharing`` limit stable_node_dups number of duplicated KSM pages +zero_pages_sharing + how many empty pages are sharing kernel zero page(s) instead of + with each other as it would happen normally. only effective when + enabling ``use_zero_pages`` knob. + +If ``use_zero_pages`` is 0, only ``pages_sharing`` can represents how +much saved. Otherwise, ``pages_sharing`` + ``zero_pages_sharing`` +represents how much saved actually. A high ratio of ``pages_sharing`` to ``pages_shared`` indicates good sharing, but a high ratio of ``pages_unshared`` to ``pages_sharing``