From patchwork Sat Oct 8 07:07:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xu xin X-Patchwork-Id: 13001710 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 60FC5C433F5 for ; Sat, 8 Oct 2022 07:07:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E5A696B0072; Sat, 8 Oct 2022 03:07:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E09BB6B0074; Sat, 8 Oct 2022 03:07:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CAAA56B0075; Sat, 8 Oct 2022 03:07:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B813B6B0072 for ; Sat, 8 Oct 2022 03:07:08 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7E99A1A025B for ; Sat, 8 Oct 2022 07:07:08 +0000 (UTC) X-FDA: 79996900536.01.01D1894 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf16.hostedemail.com (Postfix) with ESMTP id 1A46C180010 for ; Sat, 8 Oct 2022 07:07:07 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id q10-20020a17090a304a00b0020b1d5f6975so5373275pjl.0 for ; Sat, 08 Oct 2022 00:07:07 -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=GCLrh81Q8BMsf/xFgK/vL+6CrEoKNCw9UdiEuxw25yIGphTObD36x0dLFYVlVR7GOV mR32kmjJyEpYA2B4oaSUD9R2Iiy3c4MDfBsxxaGqEh/FawOGokUamFhme8kAN/eBb7WA isgPT/9okXWWL6sPCfZ8/Amnd1dgR0wAj1gyXZs2bBvCiLxRn4PixDSpqtfPJI2zuk0h lfvvAbMexpk+H6PLk75/+tSMKmcMzMxzFi6wbWA/adtSNCPYFFtgJIe7m00u49YMjVD9 QNrbLWYxIab29YLMFZ8QU8U04+0JTr+Z85icPXZ3OQKQHMlys82pWCbEZwixUjtwrMnf YMIA== 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=YVnhNM9Zcmn8WP1EivlX+nVe99thJjsh3w7AFlkwIbLXQUZ9n/32+6mDj5mVuH4Tto 6xxwSVhC1XkiJh0Ryqgh0JzG+W/ofbZtdPptF6MvI/sGsSnZRfhEHdZDFuUGkRS5ehZr C0beSObuji8Oo2/QVjSWrZ7AhLhFBp8d3ySfLIZPVQBy+E0+Bk0jdPh6qe8IhqhbtsKI W7HqZK9WTrykG7B+Uxp/zoWnGFn2E/rXtWRin6qC/FakyOHk/VnsnBc0vLvka/OkryTB iZwlgXXwadI00iP0XI6R5n/tguU5IWLDbDtsSOGnCJ271AinW0ZgkMTJfYJYh6C2Iux8 +vJg== X-Gm-Message-State: ACrzQf1fj4b6rZstK5SkS7/tLzy+oAAYDK2jsnVeIKNI7rq5/rcSZ35J 5ks8bDxDg2ENc0ZJYHwOG0Q= X-Google-Smtp-Source: AMsMyM580/WE7K2J+FERsSfMBW9Alh5kTunQhUorLRTAyVYTY4npo87/H8JMIX2EgmHypeztFjSsig== X-Received: by 2002:a17:902:dad2:b0:17f:8290:fce0 with SMTP id q18-20020a170902dad200b0017f8290fce0mr8449772plx.168.1665212827179; Sat, 08 Oct 2022 00:07:07 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id x20-20020aa79ad4000000b00562a5f29ac1sm2772054pfp.100.2022.10.08.00.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Oct 2022 00:07:06 -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 5/5] ksm: add zero_pages_sharing documentation Date: Sat, 8 Oct 2022 07:07:01 +0000 Message-Id: <20221008070701.308747-1-xu.xin16@zte.com.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221008070156.308465-1-xu.xin16@zte.com.cn> References: <20221008070156.308465-1-xu.xin16@zte.com.cn> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665212828; a=rsa-sha256; cv=none; b=0/0Or0BUYf9ouy0arQCy5K+94XW/Ivd6YHQInGhkkUDeK//EXT58U+PHJdC5JRP47oqkhU jJux4Xge1e81vTmkg89IXoFYcnoGRCXJznMmUPB6Wigfoo2Ym+4m/x0EC0H1AQvY3i3Rok FU6ZwENXhNXGQtrQ81qmurp5zMjCpas= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GCLrh81Q; spf=pass (imf16.hostedemail.com: domain of xu.xin.sc@gmail.com designates 209.85.216.67 as permitted sender) smtp.mailfrom=xu.xin.sc@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665212828; 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=3plbcXEzARF9sBTbsOVgrbHmX8dhPg4EC0ANf0wg+6npSNzzEfL8dGptcdbXANRKuM8m/0 HNz5R7LUTA0Jja6Vo110+dxvP1qwhZ30IHQVVFPKNxrO8NDTf6cshSws07B9UIpIbi8Xm/ OxwEmiicKcPNmUae/CH1jJB1Bg85R2M= Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=GCLrh81Q; spf=pass (imf16.hostedemail.com: domain of xu.xin.sc@gmail.com designates 209.85.216.67 as permitted sender) smtp.mailfrom=xu.xin.sc@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: p8hj9mshdrhipb9s3egpydhkgsffotsd X-Rspamd-Queue-Id: 1A46C180010 X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1665212827-518537 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, 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``