From patchwork Sun Oct 9 02:23:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xu xin X-Patchwork-Id: 13001882 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 90D27C433FE for ; Sun, 9 Oct 2022 02:23:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 175426B0073; Sat, 8 Oct 2022 22:23:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1005D6B0074; Sat, 8 Oct 2022 22:23:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E93F08E0002; Sat, 8 Oct 2022 22:23:56 -0400 (EDT) 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 D73D96B0073 for ; Sat, 8 Oct 2022 22:23:56 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A41D3C0D86 for ; Sun, 9 Oct 2022 02:23:56 +0000 (UTC) X-FDA: 79999815672.07.7EC817F Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by imf11.hostedemail.com (Postfix) with ESMTP id 4CBD54001A for ; Sun, 9 Oct 2022 02:23:56 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id 3so6521383pfw.4 for ; Sat, 08 Oct 2022 19:23:55 -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 :message-id:reply-to; bh=egU+pR1mu0fbwNOlCXxgUzq7eQbUYmzREvrHjyDBDLQ=; b=FdWJE/6vRDAn8HvbajJRjlWuKGPVVZTR6WsylqPO2APZ8f1RcKp5K9kqCiARH3Xq9U V5EnxnOTuyjLZ7nraOZ4hJL9HFQLuXXTypF7DuSg78Hcl7eB2DQNVtm+VEsqbLqrScXj bqfp0HFPy7pjoofF2hiOk6+zjPrkxK2WWrVo08cy6Kso9D7Jpt84VbaHa4i/ZFRw28hr 4bswpnvPHNEPsOAIFef/2tH3zUYktDeBjOuFnxLHWuduMLfLYK5iTU6Gvd7Ycf7Gt80x cKmq/IlFz6SJSzpOfSDUEsLvV/45SjvobCKXVcHSPntydwzKr+D82DPMsZtbETHh1mbN 5Acw== 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:message-id:reply-to; bh=egU+pR1mu0fbwNOlCXxgUzq7eQbUYmzREvrHjyDBDLQ=; b=T5aLmD1PV2DQpys7cUFaCC/sCKOTF0QnG+YfmCr/33dGuEzDYSsNKiMpqKuDzUN4D7 BfR+1FCHM7pP6ZXcHHjBwcLITQW2j38n8H0OxQAMxIribaDJCq+K29xCBu0zzAxR1wMb tB9Slk9c19hn6UeO8kxAxk77DB1PSsOZd0zJBIZ6SviNCbp0a9ju+ths1XWcASnEBU/U bMdx/MYflu06IX94+QfKzcq/LFrQWzZnQDqUXJyNkXyRYdUDjO2+Ahx0bO6D3A7ZxWA1 0v+n6q9bpuMN0on+5tKgdmskyiCRHXGh+vufgMW7oh/2Ghy1BQ02Q0AcXqoY0ydLaUky Y2lQ== X-Gm-Message-State: ACrzQf2R941EMST8qpCPK0EjXQ6BzOETehmE9svf+glj85urs/TseHHI yZKbaRzezt2+WTMEgBVOnw4= X-Google-Smtp-Source: AMsMyM7o7JzcVNgFATm6Jdoddk7BfGlH243B6v/ltjwvoqVHJMMH9h0GiNCq1I8FeHbulnNpJtrPyA== X-Received: by 2002:a63:ed0a:0:b0:442:2514:95f5 with SMTP id d10-20020a63ed0a000000b00442251495f5mr11113497pgi.402.1665282235332; Sat, 08 Oct 2022 19:23:55 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id e17-20020a17090301d100b00177f4ef7970sm4018521plh.11.2022.10.08.19.23.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Oct 2022 19:23:54 -0700 (PDT) From: xu.xin.sc@gmail.com X-Google-Original-From: xu.xin16@zte.com.cn To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, xu xin , Xiaokai Ran , Yang Yang , Jiang Xuexin , Claudio Imbrenda , David Hildenbrand Subject: [PATCH v2 5/5] ksm: add zero_pages_sharing documentation Date: Sun, 9 Oct 2022 02:23:49 +0000 Message-Id: <20221009022349.315482-1-xu.xin16@zte.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221009021816.315205-1-xu.xin16@zte.com.cn> References: <20221009021816.315205-1-xu.xin16@zte.com.cn> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665282236; 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=egU+pR1mu0fbwNOlCXxgUzq7eQbUYmzREvrHjyDBDLQ=; b=lTtq5slpVDspAKhAMUA/+tOLGefVMf49fqBuIkkCQNBXa2f0IHgdBoYrkJNObuMMhFnkF2 nFaQSVCMha/rKc4SqHM8LjbSDt8OZqIs3JC6w4TNwKIdx9ZRtU/D4gx2MTizyrRktUvrtj FQvAcmo1Z4J8+UceLNqfVVkgU+nGMHc= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="FdWJE/6v"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of xu.xin.sc@gmail.com designates 209.85.210.196 as permitted sender) smtp.mailfrom=xu.xin.sc@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665282236; a=rsa-sha256; cv=none; b=LO1OKz8Y6T5Cee9zCjjJ1IsgRJjdqlH90NqnEqhIchiSFwqq6h2QNTjCP4UrwKSKDPtCxV 0HFcpZSONk+lacCB9EJQPovj1gsMMW+pzyNkuK+nyMRWfH/31OJIhxXqAJxD7CLxObt0QI efWylAPAmIzOk9K545O1OsxdFx/jEOM= X-Stat-Signature: quyjdc9r31xk4k4o99m9cxc3rjgyas6t X-Rspamd-Server: rspam09 X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="FdWJE/6v"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of xu.xin.sc@gmail.com designates 209.85.210.196 as permitted sender) smtp.mailfrom=xu.xin.sc@gmail.com X-Rspamd-Queue-Id: 4CBD54001A X-HE-Tag: 1665282236-257835 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000484, 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. Cc: Xiaokai Ran Cc: Yang Yang Cc: Jiang Xuexin Cc: Claudio Imbrenda Cc: David Hildenbrand 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``