From patchwork Thu Nov 11 04:15:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 12692253 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 766FCC433F5 for ; Thu, 11 Nov 2021 04:24:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 487B56134F for ; Thu, 11 Nov 2021 04:24:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 487B56134F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=TpASqa/li/xENpu+t9rKR5lANcb6F16EHvpu4ZOJ2Zw=; b=FJlKVCxDfGxM2tEb2IRmSvWoIc OQkQqtQ+iZFMnwANEMnpDjHsAdU7IsgDj54BJhcbT7FEpp5Aq49Fm3+ol718k6/sxVk4L9M27oBS/ LTNK3d3XfMvqPWqkfGJeE2DkOvUf7cw45PE3dTk9t3aBr6fdxeIMA26a2O6PblwcTcslvUzWER0g9 QBnbJKgn8PAmxOLcxkupHONSwzl5h573GIS/+giDSd4Ram5NcFzRlVwjWQBv73w93tLr/AtGbPscg hN8XcBUA5B60SgMojXW5Ltx4X0tafrTRwjkfswYhzy4iNbdpxRoTkmZxZl+D/4mV8QpZBLuX/tvcC le8Jsikg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ml1bf-0073jL-9I; Thu, 11 Nov 2021 04:22:35 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ml1Uo-00702C-7w for linux-arm-kernel@lists.infradead.org; Thu, 11 Nov 2021 04:15:40 +0000 Received: by mail-yb1-xb49.google.com with SMTP id d9-20020a251d09000000b005c208092922so7482223ybd.20 for ; Wed, 10 Nov 2021 20:15:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=kIC1LMcPIHE6ohL1Kwjd6ilZ7X8GMiNaA5GrQJ5M6q4=; b=DSZDX2TS+IiqWyINEcziE2ZPMV4wgH5I2PBc0aBvEMA0s5evl6R+qAyN7ZJehvxAq9 bfS9VzJK7jBYgQ5pT/IRcjC+HWzlCJqn0Ky7+mISN5WTc8LvtGIdIAooird63y4SYnzd l8BFUmYGCao2goH7hiiIncaE9NsFCr2Xv5+JS42Fx8Bw3FIMTje+p+g7cN0GxFaOstPw NpREzvq2mLPcCxwH7v9kz0BnHH0LH17/ArmHjq4AyaX+z1ppg7fWOPA+46LaHJlctiH2 ITak0prmcS3w4p8UJ0HM55jWVlGzIlI8icJ9Q0luh16+c9JI9z50nxe95dDCx9VPzbI0 CF9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=kIC1LMcPIHE6ohL1Kwjd6ilZ7X8GMiNaA5GrQJ5M6q4=; b=NTxK09ISxRwJnXvYENjslwkbaNA7YW1m+Zq09YdrX/cRtP+i31VPbQxRSJ+3ZsWAgo KHKNR1MNY5+00EJaofoJ8V/cLXTarwtOEPgnIIqz4jUBHtAlkGV1H1BRbSplkdsP/wwQ kzr3Xq/ujmoAvfXK8YrzPnnaePrwsNrLbITItIeko5ipPa3q7RWpc5AkawAIZt+3RRad cRtgT3n6aGgT3+HQ24Ib7UszIYPHZ9Wg+AV6LX3M4CIG0OuL/b9IVij8zwc/cvWldo3R krs6FUOQX2LMBFa8AWTk8NoeMZ20roe6+PiHWNwBgBGjSJLX3jLXgKCgmkOZNopfALe1 igew== X-Gm-Message-State: AOAM533Gx7pfCqIJfxcLaAvB1IyUZUYAWvGzNProDy8TqRedsq+IdZS+ yWU8Nb2OGbMbJ4qo+GgK4bkwDgR6m+I= X-Google-Smtp-Source: ABdhPJz92Zjq3t52xmpJLjYhav+djnH4c5unlUZlbCxpx8Nb7FEsbdwUxBg+ssTaG7ws2vXelVoynsmiSdQ= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:346b:bb72:659e:f91c]) (user=yuzhao job=sendgmr) by 2002:a25:ade0:: with SMTP id d32mr5133433ybe.510.1636604128314; Wed, 10 Nov 2021 20:15:28 -0800 (PST) Date: Wed, 10 Nov 2021 21:15:09 -0700 In-Reply-To: <20211111041510.402534-1-yuzhao@google.com> Message-Id: <20211111041510.402534-10-yuzhao@google.com> Mime-Version: 1.0 References: <20211111041510.402534-1-yuzhao@google.com> X-Mailer: git-send-email 2.34.0.rc0.344.g81b53c2807-goog Subject: [PATCH v5 09/10] mm: multigenerational lru: Kconfig From: Yu Zhao To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, page-reclaim@google.com, holger@applied-asynchrony.com, iam@valdikss.org.ru, Yu Zhao , Konstantin Kharlamov X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211110_201530_337984_174952EA X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add configuration options for the multigenerational lru. Signed-off-by: Yu Zhao Tested-by: Konstantin Kharlamov --- mm/Kconfig | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index d16ba9249bc5..48e7babb22e5 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -896,4 +896,63 @@ config SECRETMEM source "mm/damon/Kconfig" +# the multigenerational lru { +config LRU_GEN + bool "Multigenerational LRU" + depends on MMU + # the following options may leave not enough spare bits in page->flags + depends on !MAXSMP && (64BIT || !SPARSEMEM || SPARSEMEM_VMEMMAP) + 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