Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3016786rwb; Sat, 8 Oct 2022 19:50:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UyKzf+RxH+uGkZKzYIHhYOorik+la+F1oJw1yfgBOUgCu/io48co2NZ3Uv7pLQZEXQV6W X-Received: by 2002:a17:902:6546:b0:17f:7888:58b with SMTP id d6-20020a170902654600b0017f7888058bmr11943523pln.140.1665283856432; Sat, 08 Oct 2022 19:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665283856; cv=none; d=google.com; s=arc-20160816; b=c6pvyrnlrUlzh/TfS4rOzImPmHDFW5wMlUK3C/RROP88mibBnme+5FjNSN7LzTwu0H +vMfOY/hpCArqMM43zi3EfdD/UTRRiq1jUYRhJiHyapdQBwGzfCw0qQ9p5Zw+ri7qfKD mB0qS4PKUEgIDQOKYpvI/NCtyEpVe2DRbl4EJQBV2iEOJqQluGMosBd3UGkcxiY3OPfS ngGpHnxOZ/13seJq5PocjF+CS0D73yjwmzWqjCUm9ogWcyJrh6D7+VOSgHqGVUCItOku aswaRFLGt539yEMZa/9FFqNKkn5hZd13tfFmktU1i66sOhWkbCbbVFZ2gVvmV+4EQpvG 7TyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=egU+pR1mu0fbwNOlCXxgUzq7eQbUYmzREvrHjyDBDLQ=; b=0S8FHgUNVj7UsJe6svsvnO1oHNmx+BWPyao52QolwPP7ZETtOVWqcmk3PNmwdhbugz YSRBDYbjiZxAAbH1OzQ31OcYmhuUHaiShEgmoyHnPmbZJ7erco3wQNuDVI0Pk4ciE7jf jgt8DwYYtSAjKPbuUKTktjZWqh4LS3vOPmrByRi8iFaitaxV843eWJ0Zy/AUHCnKyREb Gl24il4sakk1ZzvjDmmgdM7A+u+K/k7JyTLvhB0mUG34Gxxvd0Rt/RTsQRB/UuZboiST inM/H8umEEE0v6oSTcynKFxdaGhnu293Jh/to4gMyTAt/5H7vJN/wZkZILFgzWHvPydI i40w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="FdWJE/6v"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q9-20020a63e949000000b0044e12bf2727si8199706pgj.282.2022.10.08.19.50.43; Sat, 08 Oct 2022 19:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="FdWJE/6v"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229827AbiJICX7 (ORCPT + 99 others); Sat, 8 Oct 2022 22:23:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbiJICX4 (ORCPT ); Sat, 8 Oct 2022 22:23:56 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B98C636093 for ; Sat, 8 Oct 2022 19:23:55 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id f140so8088777pfa.1 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=D1CaahxHlEjp8+MLpvnfywQuAeqeYAKgEwQq+F6z3vVN36uXPuLCurOqiptNARpJcg IltkVBXXlX3tiOd26mmcB4Mi/Hw9GbvJG1eDO8VJineJHzIqEo91BTMPsoVXoLABk/ya 7vb6sg2l1rfFuBV7mDlgkTZX5FXGbSU3YLx1cD6tJc8Tu5JnsQALicVsCZAPi/55HzVb qbyT3PLI1EAwjMQxo4VU/EnteZ+Rg2c9mOUE0tCkncQiL7FprYBb4QcK1D/uXz52Nyji gCjofBWepDtTi+vPnNp6Ag0ePVIKc4OL4/IMyJFnFjTMFkFRIpS8du0gb+vwpDVEDjxr BTNA== X-Gm-Message-State: ACrzQf0ZANZedcfyTtyjlzjejjahIiKVstzrMwQo1TawN6MYJjL2xU3X JRZjXM3CuT3JSacuY0WhfAbGyropogI= 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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`` -- 2.25.1