Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2590822pxb; Tue, 13 Apr 2021 05:47:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmI7tfYA1SnrjXN/7KsILIQB8Yddl5OAqW5eXvqVBeKI5nhyCc4Gj7lhq587LjT4X9YX4K X-Received: by 2002:a17:902:e80e:b029:e4:b2b8:e36e with SMTP id u14-20020a170902e80eb02900e4b2b8e36emr31901969plg.45.1618318034509; Tue, 13 Apr 2021 05:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618318034; cv=none; d=google.com; s=arc-20160816; b=o+CsCwyhBE0ShdC55rJtnHWVFmLC1Lm1riaPZ+FlvlmFWMWGQfgLxszU39XtnmsuQH 2TG1Oq1qyFK4YTJ9hiphlkthJA37R9qd4ByY49dYyKtC7gFep3ub6qQt28G3g35WOQEp Uk6qmhaOdAzgjfJaLE/3YTx6VNY8TC8dPA7avJ5Ipwutmx9mldWJ8bKph3CIt2UA2x8g C11EYuhYGLiQGBnFLkwHAW9sQ+9kaYneHNera/FI2lhi4tCFybE74SR3mNPn+PpWNdJk Au+tl8sUR2Cf56+EZmUbJs4HUibhiLs/eC3fWwDKXUqrNDqnw88k6f2Fl80Lhu6kDBjv zGGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=OWomzY5O6nIPdL3TO8CK9fbu3idsDsiJdhlQbcNCNmk=; b=a7fDyGAdyXVEX0sqw8h9v59ADp0HFwRWIDE3KCWEj2s6WIuiix1gfN/cw63paNgkzp rjXzTEi7upwTO5IIbj/Nyk96BqHhZ/M3cqUGHM81XsNMJvVi6N6FknAjrcDYRrIhZTZ+ aw1bpWayA60nfPOQ9YVTGgh86v91oaR9RyFHTXjFhtaDHqGkN167vMBIVnTFierhS2N9 RSA6iKd6xKwt/f9ofefXi4pLPSFnTTy7s3Fl8wDCign8uIxaEAWyaGNGD7UOhzqHGD96 sEy3kkrqh0FEg0WsgeCicFcDjBpxuF59T6dwP6h0gikYOsKfKZZl9F1kZSzHjB36KF4K setQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hLHfxFzp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si2938635pjw.170.2021.04.13.05.47.01; Tue, 13 Apr 2021 05:47:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hLHfxFzp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237205AbhDMG6C (ORCPT + 99 others); Tue, 13 Apr 2021 02:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345121AbhDMG5X (ORCPT ); Tue, 13 Apr 2021 02:57:23 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90316C061574 for ; Mon, 12 Apr 2021 23:57:03 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id c4so2057580ybp.6 for ; Mon, 12 Apr 2021 23:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=OWomzY5O6nIPdL3TO8CK9fbu3idsDsiJdhlQbcNCNmk=; b=hLHfxFzp5QFiDV0NCweRKZIoXrgJbYlQcW+yuS+vLMPcNKKc255Fg3tjNqfooV/OLd U6CQ3iwK8H6zMls3pFdMBN0NLbmWj6RWEYNi/DCM+PrHNrSzMnt6S2Lg4zq0wvg3486H +sx4x6j4kxGh5x9L9qgA+TxXylPtgpu5ds2+dsX0pD8ntrVyPxV7AvsnWB6UiW1V9ZVk /LsyUFz5OtLMbBTake9P8xyrPjX9eTcGBEel6+oOeQ/dZObXKYPRK8qTg6fk2FWETrnD Zbg2sgYJYwkCg4UC1pmuVjLWdyS1iObkTDP9YTfrBRXxxrrkE/8ced456rnZvUMSg1he l4YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=OWomzY5O6nIPdL3TO8CK9fbu3idsDsiJdhlQbcNCNmk=; b=V7wMyHi072dce6ZnPpEv7/vgyxfGH4iYzC8xiwylgcN9u4SyLFR8AsWrgIpv2mVFrC H9+fkRd2whFAERf06443LAgIA7SIiztKoG2b9INedj5rird9Kes1pDEafZP04/dNwIll hJeAUb9N1qmeVv6vZIZsKpWDp0D/wa5gCBze6PfyzFRL82n1sUxPv6wP/l9ClegByA3J 8il8uC4X+iRjk3XACwZG+JrS7i4d2Q+qkj3ANVNNGNcDhaHbgsucUpMzpVDJleKoVoBL Luvyo5PCSA38KyflkQS+SzfwNoU60rrlTa6oBMVzyUgoPqp3RNtFIp4yyJUcill3qvqi 5ymw== X-Gm-Message-State: AOAM532nNDpt3iSLmHBos2xzSSPUScQwSS+AZ2hM1blhHygr52zHuQkq triAdzH/rSQIePQ4klFd5q1eM3rRWnU= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:d02d:cccc:9ebe:9fe9]) (user=yuzhao job=sendgmr) by 2002:a25:cc90:: with SMTP id l138mr2006126ybf.150.1618297022801; Mon, 12 Apr 2021 23:57:02 -0700 (PDT) Date: Tue, 13 Apr 2021 00:56:32 -0600 In-Reply-To: <20210413065633.2782273-1-yuzhao@google.com> Message-Id: <20210413065633.2782273-16-yuzhao@google.com> Mime-Version: 1.0 References: <20210413065633.2782273-1-yuzhao@google.com> X-Mailer: git-send-email 2.31.1.295.g9ea45b61b8-goog Subject: [PATCH v2 15/16] mm: multigenerational lru: Kconfig From: Yu Zhao To: linux-mm@kvack.org Cc: Alex Shi , Andi Kleen , Andrew Morton , Benjamin Manes , Dave Chinner , Dave Hansen , Hillf Danton , Jens Axboe , Johannes Weiner , Jonathan Corbet , Joonsoo Kim , Matthew Wilcox , Mel Gorman , Miaohe Lin , Michael Larabel , Michal Hocko , Michel Lespinasse , Rik van Riel , Roman Gushchin , Rong Chen , SeongJae Park , Tim Chen , Vlastimil Babka , Yang Shi , Ying Huang , Zi Yan , linux-kernel@vger.kernel.org, lkp@lists.01.org, page-reclaim@google.com, Yu Zhao Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add configuration options for the multigenerational lru. Signed-off-by: Yu Zhao --- mm/Kconfig | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index 24c045b24b95..0be1c6c90cc0 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -872,4 +872,59 @@ config MAPPING_DIRTY_HELPERS config KMAP_LOCAL bool +config LRU_GEN + bool "Multigenerational LRU" + depends on MMU + help + A high performance LRU implementation to heavily overcommit workloads + that are not IO bound. See Documentation/vm/multigen_lru.rst for + details. + + Warning: do not enable this option unless you plan to use it because + it introduces a small per-process and per-memcg and per-node memory + overhead. + +config NR_LRU_GENS + int "Max number of generations" + depends on LRU_GEN + range 4 31 + default 7 + help + This will use order_base_2(N+1) spare bits from page flags. + + Warning: do not use numbers larger than necessary because each + generation introduces a small per-node and per-memcg memory overhead. + +config TIERS_PER_GEN + int "Number of tiers per generation" + depends on LRU_GEN + range 2 5 + default 4 + help + This will use N-2 spare bits from page flags. + + Higher values generally offer better protection to active pages under + heavy buffered I/O workloads. + +config LRU_GEN_ENABLED + bool "Turn on by default" + depends on LRU_GEN + help + The default value of /sys/kernel/mm/lru_gen/enabled is 0. This option + changes it to 1. + + Warning: the default value is the fast path. See + Documentation/static-keys.txt for details. + +config LRU_GEN_STATS + bool "Full stats for debugging" + depends on LRU_GEN + help + This option keeps full stats for each generation, which can be read + from /sys/kernel/debug/lru_gen_full. + + Warning: do not enable this option unless you plan to use it because + it introduces an additional small per-process and per-memcg and + per-node memory overhead. + endmenu -- 2.31.1.295.g9ea45b61b8-goog