Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1635734rdh; Mon, 25 Sep 2023 21:10:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTXK9c5WCFs79jIoSr5+SxLUcClP9wrHm75iCjwJDTfzUb5Ga0A7ML9nFcqVapRu3hxFlc X-Received: by 2002:a17:903:485:b0:1c6:bb3:29e6 with SMTP id jj5-20020a170903048500b001c60bb329e6mr4638223plb.16.1695701458631; Mon, 25 Sep 2023 21:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695701458; cv=none; d=google.com; s=arc-20160816; b=0WFuq/ghdde4Tsa4H8gTXWT9pkx+My6nTqznUd+bX9xHDmbIMDQx3nUxVMEwo6ulAl GOXnoKAksu8fo7GcTEFl6KBU2dPhsqRJ8v3IccylqkaWN8ZvSq7QK9aVKiJ1gKd0XbxS a+qzLKt2O3AT7DrXG4LE6yaZ8ypXmZuOfJf15vu9THnmqZjJjU1Nl6fJjtChl8rmwg2V 11UXD5nE6ekZjVaS+9QWJATjYV1ipqrzBZ0lOTCfd1Ir27xvbysDsouI+tLg1pnIrCEo oSEwj64BnCo62siHS94b/0hHkf1Oqdv5DTrJut0nq7yb9a1vnFcN08N6FNRRQ4NKh9e/ sGuQ== 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=nRm5bKQCajx84URLpQRvcjK4/PXHSs3c43bjhVyrNbg=; fh=sS+J4OyOC0EcVLWJpS3mBHGeO+0+dYZJ+ImCUfzsrH4=; b=WLfsBuYIMl7/tzaCciDF9ZdrbNSb9WdEDpkohOXgRudRcBtffkIhdOGNKYyI8suz2T pTdq7rd4rOk+43LffseCjxRAmEAhZo1EinTuUS+G0XjDrVu109CKCHfftl/LqRimQX6y YxOhKOjKowI2uxstZ1XxdH701PuiQYq8b7GkDyS4KU/jSsTiVaPgUuDY1ZEMX5FvbGkF cGOlHiUBhPBK6ImjMly5VTtnEfZOMsq4UX26xt8DDDovDV6cM9+n2l4Y7RhtcOGTvrT3 hxx4/uVq336QZd6y4w1WwWUYDt9kOAMIdTeC+EsVug9+/Y4TVSha2dea/zMfOmCdkP4Z HS8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q15-20020a17090311cf00b001b7ecbbaa13si12684126plh.152.2023.09.25.21.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 21:10:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 51D17826641C; Mon, 25 Sep 2023 21:10:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233356AbjIZEKj (ORCPT + 99 others); Tue, 26 Sep 2023 00:10:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232910AbjIZEKh (ORCPT ); Tue, 26 Sep 2023 00:10:37 -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 C80BDF2 for ; Mon, 25 Sep 2023 21:10:30 -0700 (PDT) Received: by devbig1114.prn1.facebook.com (Postfix, from userid 425415) id C9CEAC8F245B; Mon, 25 Sep 2023 21:09:46 -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 v3 3/4] mm/ksm: document smart scan mode Date: Mon, 25 Sep 2023 21:09:38 -0700 Message-Id: <20230926040939.516161-4-shr@devkernel.io> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230926040939.516161-1-shr@devkernel.io> References: <20230926040939.516161-1-shr@devkernel.io> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 groat.vger.email 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 (groat.vger.email [0.0.0.0]); Mon, 25 Sep 2023 21:10:39 -0700 (PDT) This adds documentation for the smart scan mode of KSM. Signed-off-by: Stefan Roesch Reviewed-by: David Hildenbrand --- 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