Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2783121rwd; Mon, 22 May 2023 04:25:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4APTBoj8qYfrsAB/zFVcQ1hqSzpmVmNIbKGwdY/Wq83L7d9gi9vuvTfBbD7VKZFEiT8uE2 X-Received: by 2002:a17:902:f802:b0:1ae:305f:e949 with SMTP id ix2-20020a170902f80200b001ae305fe949mr9611302plb.6.1684754741955; Mon, 22 May 2023 04:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684754741; cv=none; d=google.com; s=arc-20160816; b=byQXCwNpgUxq0lJttVVlrGepgrcAxp1FJkR7RNussBroF6lrQgxdnYlPUFaN71yWCf tBTsetpT/mscWsm5A2gInvLa4ACZoeRdqRUrm/oowhPPagb9HkV/GaCMZjtO5c5FTdxs xnHbzkFqc9AKZYmD1/jwsZX8NpZg1GhQysjRkUl9zL/cf1wfIj7ZJ7yx5ZKzoDc6JPFg wNy9i/7rstYd/qN0PyrgmSP+Bd7xhEXV1yCyeuRpxcNVU8vodUrGqKvM/W4VO4vjgv4m YoTWebiB5hC/zxsj3i6UUjU2ZjgG21KxoFtBnBLHfolgjSXxUD/O1XNeNubZyemwO9eR BVoA== 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; bh=/K1nT1hMAPCy1sS9ZSi+ba8NlO1a9AM53K+NxXVc4Aw=; b=hjEHNegYrF47UjVj92C0Dj5Ss/TRvkLQvNAXaPr/1USTixzw/eEKEH3AaCI70hnk8U mhX+OclulP3O9GfYSVmdgTZ2Mmc/jm2Fb/CIii3dGuMktveWBZ8uzp1VNZD9VL2leMU5 Tvs0uHw4lJ3AUGj28KA9D/TCuw3Kvp0HdFx3sJkJDH6LAFhfjdl2D5w7rxIBds7bEvqt GtYvJsiIYQH31CcnuTrAPEvWMMl6fnzVFRDxudPXSfGTxTjAocj2Bf6eepIqGTofHinO TGDtZF8OLcsW9AA81MZhJ/9jJz+8q4L4s6YVJM1W9JYJVC8yppB6SNEb7o344Yx7NkO4 w9Ug== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a170902758d00b001ac4f733007si4359827pll.549.2023.05.22.04.25.30; Mon, 22 May 2023 04:25:41 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233362AbjEVLSW (ORCPT + 99 others); Mon, 22 May 2023 07:18:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231883AbjEVLQe (ORCPT ); Mon, 22 May 2023 07:16:34 -0400 Received: from ubuntu20 (unknown [193.203.214.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9CB9269E for ; Mon, 22 May 2023 04:11:08 -0700 (PDT) Received: by ubuntu20 (Postfix, from userid 1003) id 664B9E1EF3; Mon, 22 May 2023 18:53:36 +0800 (CST) From: Yang Yang To: akpm@linux-foundation.org, david@redhat.com Cc: yang.yang29@zte.com.cn, imbrenda@linux.ibm.com, jiang.xuexin@zte.com.cn, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ran.xiaokai@zte.com.cn, xu.xin.sc@gmail.com, xu.xin16@zte.com.cn Subject: [PATCH v8 4/6] ksm: add documentation for ksm zero pages Date: Mon, 22 May 2023 18:53:35 +0800 Message-Id: <20230522105335.4176-1-yang.yang29@zte.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <202305221842587200002@zte.com.cn> References: <202305221842587200002@zte.com.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=3.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,FSL_HELO_NON_FQDN_1, HEADER_FROM_DIFFERENT_DOMAINS,HELO_NO_DOMAIN,NO_DNS_FOR_FROM, RCVD_IN_PBL,RDNS_NONE,SPF_SOFTFAIL,SPOOFED_FREEMAIL_NO_RDNS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: *** 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 Add the description of ksm_zero_pages. When use_zero_pages is enabled, pages_sharing cannot represent how much memory saved actually by KSM, but the sum of ksm_zero_pages + pages_sharing does. Signed-off-by: xu xin Cc: Xiaokai Ran Cc: Yang Yang Cc: Jiang Xuexin Cc: Claudio Imbrenda Cc: David Hildenbrand --- Documentation/admin-guide/mm/ksm.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst index 7626392fe82c..019dc40a0d3c 100644 --- a/Documentation/admin-guide/mm/ksm.rst +++ b/Documentation/admin-guide/mm/ksm.rst @@ -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 +ksm_zero_pages + how many empty pages are sharing the kernel zero page(s) instead + of other user pages as it would happen normally. Only meaningful + when ``use_zero_pages`` is/was enabled. + +When ``use_zero_pages`` is/was enabled, the sum of ``pages_sharing`` + +``ksm_zero_pages`` represents the actual number of pages saved by KSM. +if ``use_zero_pages`` has never been enabled, ``ksm_zero_pages`` is 0. A high ratio of ``pages_sharing`` to ``pages_shared`` indicates good sharing, but a high ratio of ``pages_unshared`` to ``pages_sharing`` -- 2.15.2