From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE790C433F5 for ; Tue, 22 Mar 2022 04:52:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3FDA66B0072; Tue, 22 Mar 2022 00:52:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3AC886B0073; Tue, 22 Mar 2022 00:52:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2747E6B0074; Tue, 22 Mar 2022 00:52:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 1936F6B0072 for ; Tue, 22 Mar 2022 00:52:55 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BE0D5A3250 for ; Tue, 22 Mar 2022 04:52:54 +0000 (UTC) X-FDA: 79270802268.20.C37DA5B Received: from mail-vk1-f181.google.com (mail-vk1-f181.google.com [209.85.221.181]) by imf25.hostedemail.com (Postfix) with ESMTP id 56F08A0005 for ; Tue, 22 Mar 2022 04:52:54 +0000 (UTC) Received: by mail-vk1-f181.google.com with SMTP id d7so9004132vkd.11 for ; Mon, 21 Mar 2022 21:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WZwFAXeypL3jPipKNgPJxQINJj6JMXunijbszepaSjU=; b=YFh0z8aRY3bgF45d2I8rgI3ST09NIq0Hofz3dyojfGq9mke2zfjLTsefMvQvUBTJgm 1qnKwVGrEXKXSj0hr1XpDupQwV09DvcSlZv2oyo79KqZp8KW5tKNq+0f1ASQPMGtcfJj P5fQrQ8ujRVKAEfEuFzSHk0AfcCg6JSuVh6LG1bUk+O7UOrgYohfOEL9uBkgKuz4Wreu Q8KI8EdVa4vu6DTWcfdyaVSbtYeXcWRWcrhBF6Lx8WDBw43iNsBdBH0EcHw0kye8ODpH XYWP2nIJloYZp0SmdNuOj8C9hJ23ZC46NCbzbhzmgg4s3AxfY1MAHIflZ+Ntz3noPvvn it6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WZwFAXeypL3jPipKNgPJxQINJj6JMXunijbszepaSjU=; b=0hmnjnRGaksy4MpayW27hhXyb4yWLJLVcYMNaCxwPTv7dGdNZNzXhZEen49CFzMeMY L+3GkGxoB4vtpzStQ6et5kugdLmm2IC4sZZacDA/6Y8cBP1GQVOHO4ycNMfI16FWOSnE 76rynWiJ/j2SmNQYsPXCgHMUw5wX5PdC58+HBMO3DGmOkD856qYfBA13eN58wLdDrJ2h ISsMzHrd3UvRNKCrK5T1yBiOQeZ1A8054+QCZP06AbtCqpHWtLlhQGdPKWtM3e+RUMnS RDeFyMHmjw21UDVdC/TD5DABumQkb79lcNoKOelu4cFSyxQ7JQvw/9lYQMPtBPjdkcB4 uycA== X-Gm-Message-State: AOAM533xGofDPXHcKiXGjNqiEJU41x+/RRofWTV3wvwdHwH+nm6oFcGi 1t2tfsqYRaZ9y4tgvS6hja6Dr8zMSpptIt8G5qukBQ== X-Google-Smtp-Source: ABdhPJxFR1nglzJK4RoUAy7iy7C1My9l/amg903cMnO5caRvyJNwsaMuy9GXoP8bTaVJxjBoEyZx6dpVzJR7dnuPQ7o= X-Received: by 2002:a05:6122:887:b0:332:699e:7e67 with SMTP id 7-20020a056122088700b00332699e7e67mr9362524vkf.35.1647924773467; Mon, 21 Mar 2022 21:52:53 -0700 (PDT) MIME-Version: 1.0 References: <20220309021230.721028-1-yuzhao@google.com> <20220309021230.721028-6-yuzhao@google.com> <875yoh552i.fsf@yhuang6-desk2.ccr.corp.intel.com> In-Reply-To: From: Yu Zhao Date: Mon, 21 Mar 2022 22:52:42 -0600 Message-ID: Subject: Re: [PATCH v9 05/14] mm: multi-gen LRU: groundwork To: Prarit Bhargava , Justin Forbes Cc: Andi Kleen , kernel-team@lists.ubuntu.com, Vaibhav Jain , Rik van Riel , Mel Gorman , Catalin Marinas , Johannes Weiner , Aneesh Kumar , Brian Geffon , "open list:DOCUMENTATION" , Jesse Barnes , Sofia Trinh , "Huang, Ying" , linux-kernel , Steven Barrett , Shuang Zhai , Donald Carr , Oleksandr Natalenko , =?UTF-8?Q?Holger_Hoffst=C3=A4tte?= , Will Deacon , Dave Hansen , Jonathan Corbet , Mike Rapoport , Andrew Morton , Jens Axboe , Hillf Danton , Michal Hocko , kernel , Suleiman Souhlal , Daniel Byrne , "the arch/x86 maintainers" , Konstantin Kharlamov , Matthew Wilcox , Linus Torvalds , Michael Larabel , Linux-MM , Kernel Page Reclaim v2 , Jan Alexander Steffens , Linux ARM Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=YFh0z8aR; spf=pass (imf25.hostedemail.com: domain of yuzhao@google.com designates 209.85.221.181 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 56F08A0005 X-Stat-Signature: 1w6rcdr4au448pizwmh7sq4ajz37czge X-HE-Tag: 1647924774-498542 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Mar 21, 2022 at 1:18 PM Prarit Bhargava wrote: > > On 3/21/22 14:58, Justin Forbes wrote: > > On Mon, Mar 14, 2022 at 4:30 AM Yu Zhao wrote: > >> > >> On Mon, Mar 14, 2022 at 2:09 AM Huang, Ying wrote: > >>> > >>> Hi, Yu, > >>> > >>> Yu Zhao writes: > >>>> diff --git a/mm/Kconfig b/mm/Kconfig > >>>> index 3326ee3903f3..747ab1690bcf 100644 > >>>> --- a/mm/Kconfig > >>>> +++ b/mm/Kconfig > >>>> @@ -892,6 +892,16 @@ config ANON_VMA_NAME > >>>> area from being merged with adjacent virtual memory areas due to the > >>>> difference in their name. > >>>> > >>>> +# the multi-gen LRU { > >>>> +config LRU_GEN > >>>> + bool "Multi-Gen LRU" > >>>> + depends on MMU > >>>> + # the following options can use up the spare bits in page flags > >>>> + depends on !MAXSMP && (64BIT || !SPARSEMEM || SPARSEMEM_VMEMMAP) > >>> > >>> LRU_GEN depends on !MAXSMP. So, What is the maximum NR_CPUS supported > >>> by LRU_GEN? > >> > >> LRU_GEN doesn't really care about NR_CPUS. IOW, it doesn't impose a > >> max number. The dependency is with NODES_SHIFT selected by MAXSMP: > >> default "10" if MAXSMP > >> This combined with LAST_CPUPID_SHIFT can exhaust the spare bits in page flags. > >> > >> MAXSMP is meant for kernel developers to test their code, and it > >> should not be used in production [1]. But some distros unfortunately > >> ship kernels built with this option, e.g., Fedora and Ubuntu. And > >> their users reported build errors to me after they applied MGLRU on > >> those kernels ("Not enough bits in page flags"). Let me add Fedora and > >> Ubuntu to this thread. > >> > >> Fedora and Ubuntu, > >> > >> Could you please clarify if there is a reason to ship kernels built > >> with MAXSMP? Otherwise, please consider disabling this option. Thanks. > >> > >> As per above, MAXSMP enables ridiculously large numbers of CPUs and > >> NUMA nodes for testing purposes. It is detrimental to performance, > >> e.g., CPUMASK_OFFSTACK. > > > > It was enabled for Fedora, and RHEL because we did need more than 512 > > CPUs, originally only in RHEL until SGI (years ago) complained that > > they were testing very large machines with Fedora. The testing done > > on RHEL showed that the performance impact was minimal. For a very > > long time we had MAXSMP off and carried a patch which allowed us to > > turn on CPUMASK_OFFSTACK without debugging because there was supposed > > to be "something else" coming. In 2019 we gave up, dropped that patch > > and just turned on MAXSMP. > > > > I do not have any metrics for how often someone runs Fedora on a > > ridiculously large machine these days, but I would guess that number > > is not 0. > > It is not 0. I've seen data from large systems (1000+ logical threads) > that are running Fedora albeit with a modified Fedora kernel. > > Additionally the max limit for CPUS in RHEL is 1792, however, we have > recently had a request to *double* that to 3584. You should just assume > that number will continue to increase. Good to know. Thanks. >From the standpoint of overhead, I'd consider NR_CPUS=4096 and NODES_SHIFT=7 as the next step, before going with MAXSMP.