Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2755315rdb; Tue, 12 Sep 2023 11:02:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGC+3biAyRyeipS2nZhsK7ouVD0YxSSCzQKUyhF3yBeO7XmJzqfz+tu/rQxDNFblp7Q4Z5D X-Received: by 2002:a17:90a:ca15:b0:26b:48e8:cd76 with SMTP id x21-20020a17090aca1500b0026b48e8cd76mr6959pjt.37.1694541733769; Tue, 12 Sep 2023 11:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694541733; cv=none; d=google.com; s=arc-20160816; b=DFNOhW+JLThEn3CR7oblYgQFpk5w6OpbCmJ1h73Ddf3/dTjSAo6h/s+9GmGO0ZL8km S91AY9yP4VhjLyWCxVuGT4AfL2X9+BnEUo9B1ruV6f48wxglcIeDqIpxDovjs53PJO8I 3OS/qxfmF1L/uyMDLfK4vz5R/Q6tf7T8xCnFqtaxs6XXO7NVf/V6ZYOaVuET9KbZ0Wh8 Dcsb63yHmkSv3gvdPIYq4m0xW5YG8nfjUBWdnQ/NQWVStxjf276WVRtg52i5GveNkJuh GYI3jGkAP1WgLZVRhv2KucQy7EVoJ8v75pW3oNqOhSq5JomMQSonCWPjwKat4EXjFpIF hf4A== 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=7hiLlIvC4E6ZG09k10WszVkbuStDhbkQ3XWN2o6TQ4s=; fh=sS+J4OyOC0EcVLWJpS3mBHGeO+0+dYZJ+ImCUfzsrH4=; b=kJJgVUD3+6cspddN9J1ehXiCt0a+lqQLK3G+9jb5fnuoBwlyZVqEDCWCPg8dHC3gw2 PcsOfGjT6oJZH460xYBdKUKH3kiDvZU15lBWmP3p4cKkw9KfkU1jUFGj17Sh3Eca9khE UG4r/wniqKxtyP5VPOoef+VXacxVqZFjcbRZn9tQKEgRvIYBeI5R/AFtQqPelVLno6YN vEiqIfR9hBD+Siw8CgrfR35EgiY27ynQ6vwA5r1rL5pUwuzNdOk+RNEHmABcHz4pmp5Z isfHgHqjhbdmLUTjZvhTiD0jHbV7Q2DIOYuL9rtY0ZTvRRjUhf7ZbY7CyPoRCx1XLKTb EGdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c63-20020a17090a494500b0026335941736si10181431pjh.144.2023.09.12.11.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 11:02:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 696FE816EBC1; Tue, 12 Sep 2023 10:54:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237299AbjILRxk (ORCPT + 99 others); Tue, 12 Sep 2023 13:53:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237253AbjILRxW (ORCPT ); Tue, 12 Sep 2023 13:53:22 -0400 Received: from 66-220-144-178.mail-mxout.facebook.com (66-220-144-178.mail-mxout.facebook.com [66.220.144.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FD111FE7 for ; Tue, 12 Sep 2023 10:52:53 -0700 (PDT) Received: by devbig1114.prn1.facebook.com (Postfix, from userid 425415) id 467C8BCD162E; Tue, 12 Sep 2023 10:52:39 -0700 (PDT) From: Stefan Roesch To: kernel-team@fb.com Cc: shr@devkernel.io, akpm@linux-foundation.org, david@redhat.com, hannes@cmpxchg.org, riel@surriel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v1 3/4] mm/ksm: document smart scan mode Date: Tue, 12 Sep 2023 10:52:27 -0700 Message-Id: <20230912175228.952039-4-shr@devkernel.io> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230912175228.952039-1-shr@devkernel.io> References: <20230912175228.952039-1-shr@devkernel.io> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Sep 2023 10:54:02 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email This adds documentation for the smart scan mode of KSM. Signed-off-by: Stefan Roesch --- Documentation/admin-guide/mm/ksm.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-g= uide/mm/ksm.rst index 776f244bdae4..1762219baf51 100644 --- a/Documentation/admin-guide/mm/ksm.rst +++ b/Documentation/admin-guide/mm/ksm.rst @@ -155,6 +155,15 @@ stable_node_chains_prune_millisecs scan. It's a noop if not a single KSM page hit the ``max_page_sharing`` yet. =20 +smart_scan + By default KSM checks every candidate page for each scan. It doe= s + not take into account historic information. When smart scan is + enabled, pages that have previously not been de-duplicated get + skipped. How often these pages are skipped depends on how often + de-duplication has already been tried and failed. By default thi= s + optimization is disabled. The ``pages_skipped`` metric shows how + effetive the setting is. + The effectiveness of KSM and MADV_MERGEABLE is shown in ``/sys/kernel/mm= /ksm/``: =20 general_profit --=20 2.39.3