From patchwork Thu Apr 13 05:56:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yang X-Patchwork-Id: 82814 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp817111vqo; Wed, 12 Apr 2023 23:10:35 -0700 (PDT) X-Google-Smtp-Source: AKy350b8xSUB9CJYYl7WUFqbzT0mXEbt2vwHqJ+Kj873wV9bqXAsSarTQtvmPbgwlHLXJmcxmQXn X-Received: by 2002:a17:906:6b82:b0:947:80a4:5cce with SMTP id l2-20020a1709066b8200b0094780a45ccemr1586511ejr.65.1681366235596; Wed, 12 Apr 2023 23:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681366235; cv=none; d=google.com; s=arc-20160816; b=vmQZK7PCCXeqMMy122iF7AXFyi+8mGjUcsLvK53UNmesutHHH4xgo8Gs+Y+7omu+QK RES3ph5yy0emDJFDsERy20NdPil9Jd9kWPA8eaaotcKL2/ZuiFxSswCVlmGSxiLfxR1k 1cPPuQGyMeWStOPBdsxuZXGTsDOOptGTVLVcm1W+sha5Ml8i2OeUyF8F7uBXLek/aVPO L3IuSxbZIea5JiFThsDt+Hz1SYoEmb2xu47DSVhLI2kLyWb74ksDdlKa9fdUPCt7wjpy aypaF2IEK0r7cYPh70XVE5GXn4uNOElcEfMdhCNKmZDN9oAiQuCjgEAE40SauAdFbGyI w9qQ== 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=h6V8qbBgpVfM77YYNOimOspt95XUGpnjfIrUlzQ1YjU=; b=J+fI8e4erjN2zmv0dgOgTVu4b3EEi+e9fnoQVJfEoQSufSOSNXy5BeNUCCnb+8YrMR WSIC7CHgd2Vp+uhh+pwZKNslZgq47IwMsxfdVxrir3VNR/pC3DjlQ2GOsY/eCk+HHPz8 U8v5dK2CCIF5GdlAEAJA33obFPUOpyjkHG1P/Whlt/E6NHjoUQ0DBIUOl+FmxOe4nhO0 BK2oKWxp+opM5GGCb/C21EBzR+TNQWj49LfTFkjmapj+gG8bvYq1XZlN3Jl+wDVKmVFS O9rczHkCsReagCKGpGwtJfjZa6TYE+VhKhpd1Nsnop+w7VNeQTwFHzoOnCaLrEAmgPER A2bw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mv14-20020a170907838e00b0092a8aa23062si926342ejc.571.2023.04.12.23.10.11; Wed, 12 Apr 2023 23:10:35 -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 S229615AbjDMF4k (ORCPT + 99 others); Thu, 13 Apr 2023 01:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbjDMF4j (ORCPT ); Thu, 13 Apr 2023 01:56:39 -0400 Received: from ubuntu20 (unknown [193.203.214.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FD814ED8 for ; Wed, 12 Apr 2023 22:56:38 -0700 (PDT) Received: by ubuntu20 (Postfix, from userid 1003) id 39CBDE1A1F; Thu, 13 Apr 2023 05:56:37 +0000 (UTC) From: Yang Yang To: akpm@linux-foundation.org, david@redhat.com Cc: yang.yang29@zte.com.cn, imbrenda@linux.ibm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ran.xiaokai@zte.com.cn, xu.xin.sc@gmail.com, xu.xin16@zte.com.cn, Jiang Xuexin Subject: [PATCH v7 4/6] ksm: add documentation for ksm zero pages Date: Thu, 13 Apr 2023 13:56:35 +0800 Message-Id: <20230413055635.181156-1-yang.yang29@zte.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <202304131346489021903@zte.com.cn> References: <202304131346489021903@zte.com.cn> MIME-Version: 1.0 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763040281709295512?= X-GMAIL-MSGID: =?utf-8?q?1763040281709295512?= 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 60dc42b3a6a8..64e6a13bda74 100644 --- a/Documentation/admin-guide/mm/ksm.rst +++ b/Documentation/admin-guide/mm/ksm.rst @@ -212,6 +212,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``