Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2113160pxj; Wed, 19 May 2021 23:57:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyavAy2k07KJH8lnrGsR7ME2+jcPQz/9HzgLx9fbwoSdtSu93at3h0rTtLKZimjqpNTCtcp X-Received: by 2002:aa7:dc49:: with SMTP id g9mr3354111edu.160.1621493838488; Wed, 19 May 2021 23:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621493838; cv=none; d=google.com; s=arc-20160816; b=BoMaWbHS9+kOYwUEk8aZfg65Nf/bSVj38wMXoQB1jBDpoSl3+jBgqulM+8XiqVOmAR uhCwi4SW4loMHbfvn7GtvB54kOh7cWVbiPukY1h4ffxS09YO4ztrNbUYUECcZIBWdIVJ fjQEM0JVjnQHNkxWBMXXWU0TAvIE8bKhlq8deI/yvZMowIFCJQfgUEdW9pNOotH+OgVS 0foHboCaUK4UOdqoz4pi38i15IxtPyVnbDDLo+CbbWvkSaH3PA3g+U5UaIlAAyqxy2yF vg3HV3EXDFF/k39XNSp7xFFBxfjgdgQBhlEd8zk1cvhHwWvPCb08AqiwRvTz7OjEq09O VIEw== 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=RJZRi3A5hgCw5vurGae674wlMdAubVgl39rxTDtDyVU=; b=cE1xaerdc9h00pomcOBJpgIXj6ytQUJ8n6qe6NehzBDFKYoFSTym6wR/4wHaP+0CLw X6zEbhULFJolsmS7sYnkzDRu/thbCs4ZPmA/AQVH+sy8XPaQMRX86Nf+JNch3XOCVS1F 6iQtlhEgSMzvTEDglF5i4Tng++5S11tleqc4cEOcOJ2I40pWiolyoHkcgVSo5IVYrMp0 s/A1tgD/yiBm3q52SPoO7tsObBAOfjW4ItBZgfmdaAht65/eQiU0NMxBW82U1RhiKweB 4fja6/lp6GOZGoAgMqzTQ9MEZR5SJZNs9vgIQZtZHYna1J+AtOw02ZpkEecHpM9hu0Vu BhLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JLF6ekZq; 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 h3si1517885edw.187.2021.05.19.23.56.53; Wed, 19 May 2021 23:57:18 -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=JLF6ekZq; 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 S231241AbhETG4F (ORCPT + 99 others); Thu, 20 May 2021 02:56:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231130AbhETGzn (ORCPT ); Thu, 20 May 2021 02:55:43 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38C6EC061574 for ; Wed, 19 May 2021 23:54:22 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id e138-20020a25e7900000b029050df4b648fcso15235225ybh.7 for ; Wed, 19 May 2021 23:54:22 -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=RJZRi3A5hgCw5vurGae674wlMdAubVgl39rxTDtDyVU=; b=JLF6ekZqpQB+K5YXwsizPGhNysHViGntJ8r9yptD6ne6XqGKoI0Wr7dT82jfftMw45 KOQGieGgRV+BKuZtTbu4cD96tkttpjfquqm9xT5G1x+H3lcXyVbFnA/e0Iz2BGxOx/oJ BP1OK9ib2xvMirn2ogaiMLLuQUMqUVLP4SPszQpLdYUpmsyvtcBjEJsyZiQXMIULinqi S2oaVggbJoWpCxB/3pF4W62fMm5D/LXGAxEWoOTfyY0Ng+NdQ206TROqcoNsbbncUKfa mpyuoyCTOYlALfoNN1kP2lNPrNTUz+UQK31nuEwEnfTBGdsmWTsTelrdxl+7zutfQ7Vh E6Ag== 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=RJZRi3A5hgCw5vurGae674wlMdAubVgl39rxTDtDyVU=; b=I4OJloc251SYLj8eJFPP7eJ7uA2r6NXUj5S3hGT6Cv3INg/pbFfz6U56wMbDKeUUx2 PFZUxNbewINRi+Xyu0XORumSFYK8cRNAA2xJjsiB/Mi20wJutqQp8eggHjJ4klnT3Arg fC/Qi7JDEKR9akyObrL1SszlU1EyBRMRlSuA56tL8Ayw3KSXAha5WNL73FfjPvnDX4Jn bmGmhKmr4OxIJyYH+35RFfAEzVEoAkRi3miAuWb8eWC6T+GXdpovk6EqvlqSAS4RZyph hWXp4amXtIPmK3meD1g4aF/hJ6IDATp3RWD8SfDV+tNQHU5Wvz3exLpVhhmIWwqq93UL V4jg== X-Gm-Message-State: AOAM532JcEmtEayMiu5r4FpU7325mYFfTWklXmMaEvDn+KHT0zqmqSZv de4I079gO1eY+8FLxSzEABlOF2R4isA= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:595d:62ee:f08:8e83]) (user=yuzhao job=sendgmr) by 2002:a05:6902:4b3:: with SMTP id r19mr5173987ybs.290.1621493661349; Wed, 19 May 2021 23:54:21 -0700 (PDT) Date: Thu, 20 May 2021 00:53:54 -0600 In-Reply-To: <20210520065355.2736558-1-yuzhao@google.com> Message-Id: <20210520065355.2736558-14-yuzhao@google.com> Mime-Version: 1.0 References: <20210520065355.2736558-1-yuzhao@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH v3 13/14] mm: multigenerational lru: Kconfig From: Yu Zhao To: linux-mm@kvack.org Cc: Alex Shi , Andi Kleen , Andrew Morton , Dave Chinner , Dave Hansen , Donald Carr , Hillf Danton , Jens Axboe , Johannes Weiner , Jonathan Corbet , Joonsoo Kim , Konstantin Kharlamov , Marcus Seyfarth , Matthew Wilcox , Mel Gorman , Miaohe Lin , Michael Larabel , Michal Hocko , Michel Lespinasse , Rik van Riel , Roman Gushchin , 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 , Konstantin Kharlamov 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 Tested-by: Konstantin Kharlamov --- mm/Kconfig | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index 02d44e3420f5..da125f145bc4 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -901,4 +901,62 @@ config KMAP_LOCAL # struct io_mapping based helper. Selected by drivers that need them config IO_MAPPING bool + +# the multigenerational lru { +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 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. + +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. + + Larger values generally offer better protection to active pages under + heavy buffered I/O workloads. +# } + endmenu -- 2.31.1.751.gd2f1c929bd-goog