From patchwork Mon May 22 10:53: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: 97310 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1373768vqo; Mon, 22 May 2023 04:29:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hO4GD3UUloEXc87VYliAUMkBktGqE3Zreg6iXvWIfKhkFWFBXpr+li0jrpHqQ9cFDNxYG X-Received: by 2002:a17:90b:2386:b0:255:338d:4652 with SMTP id mr6-20020a17090b238600b00255338d4652mr6170080pjb.33.1684754945397; Mon, 22 May 2023 04:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684754945; cv=none; d=google.com; s=arc-20160816; b=kWZzRLGhYQECB8HTcFP/HPCcq10mDs1dEmCdZQG6TeW9uEav6jqwblc8pNHR9g+FbN dvQDYWtxhjyWVLQfHGKsM+VeVqoyihZjMY9A2UDT3dR37F51Xr50rEZuhllnmumrTgf8 zQw2zUv1I6X4pL89f7QEr0/L9nB3dyjPSkO4pg5gEgCk7tYBdvpcsVc/EBbxoDNL6wxm q2M7Q3Pr0KkGELbmYr3foA96mQzclNVB+RzRIiaTGhPdZXvuyDfutHChb8Lxt355xyIH sGnabs63UMw7srWwUybpj24j6qRpmN7Grfmi+2lzMexYHsGVXyMlEhzd+d3gBGo9jwT6 ECMA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o23-20020a17090ac71700b0024df9227b1asi6689976pjt.167.2023.05.22.04.28.53; Mon, 22 May 2023 04:29:05 -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 S233363AbjEVLSX (ORCPT + 99 others); Mon, 22 May 2023 07:18:23 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766593601530456007?= X-GMAIL-MSGID: =?utf-8?q?1766593601530456007?= 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``