Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2498792pxp; Mon, 21 Mar 2022 22:40:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwETTWE2xn+GGmSmmpWYQLNmQmjvztIrz4ykBv4don0Me85LhJaL2UndqF1/leJIFZUlDnL X-Received: by 2002:a17:902:e5c3:b0:154:7d95:ba7e with SMTP id u3-20020a170902e5c300b001547d95ba7emr3109911plf.140.1647927617987; Mon, 21 Mar 2022 22:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647927617; cv=none; d=google.com; s=arc-20160816; b=muR1dBGM3EOJwlAlaPzBE0rYupJVi3lMWNwB7NoZ3V++YQAPjM8O6PrPkh49MaW6Fp LdjlAoDD/jXyBoRAXOQtlSYJ52urOfts8qdqqfzgoAC/u4Z7IWdhq8Eoz9LF4SlTLPcZ msbBcdXDpy2IEA2GxmiUbXa1mfL+HXxAYPHcE+uI1Y8z1pvfc8F05FGm+RBWhD+q0m2+ LIe+dctNZV90Zf5pqmtO0ae0Z0nbSyZNGyQVbLvQLfrI8gN9ZRfCTWJPblxfgbLMOJ0B sCdyUFt4O/ABoQkn0z8/eVOVndlPTFhJ2a+3OjhYRjhSJIEitZoWKFnO9n+wGqBR92cg traA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WZwFAXeypL3jPipKNgPJxQINJj6JMXunijbszepaSjU=; b=L7BId2E+Y2a2s8naQo0rUPK1SPH8644gyt8cXkcQe9/j872d/C0uxRtpl6PzIV/Epm nbdcbBPkSwLnyGGYSRhyvblExDv2a2F5J3GO1Dn0sjzK0etJxTBY0+n72q7aRUo6XR8A Ome0O7LYppqyUTBGhpLDg7YSkl9vKUBH200uZviSEuvmjGWnq0bqMZXlqOou6bN9CNo5 zXOdTBmsCjbR8tCfP92Se0bLYdqdSZr61XJcmZdV7sOuoYBikXpPNyqD2nsRQQVTNbrs cZDOhd4I/EQECTaiR+w2hphry1iNWIsDq6iadoBBt+I1GumQV/lW6Jj5yHeBPjNebR17 FFmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=YFh0z8aR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n8-20020a654508000000b003816043f0f5si15109775pgq.746.2022.03.21.22.40.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 22:40:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=YFh0z8aR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3163BCF4B5; Mon, 21 Mar 2022 21:53:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236572AbiCVEyX (ORCPT + 99 others); Tue, 22 Mar 2022 00:54:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236567AbiCVEyW (ORCPT ); Tue, 22 Mar 2022 00:54:22 -0400 Received: from mail-vk1-xa2c.google.com (mail-vk1-xa2c.google.com [IPv6:2607:f8b0:4864:20::a2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 958CC98F73 for ; Mon, 21 Mar 2022 21:52:54 -0700 (PDT) Received: by mail-vk1-xa2c.google.com with SMTP id d129so3545236vkh.13 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=cAKU06FbLnOd1S3zOpwTcDmS7nQH1vjaeMwSGOEN0j6SXNnos1ZCcz15b98joR6Ccc GDg5OcuUeh8TuGALgEzzGjqojhNGD0d5kDX1hcwm2+CMM2qVkryJpiE1i+Xpx/j5EFiJ mEDVK8X8zwHoApzzjHSBg2nzw9QT7VTcZo9iK01knl/isHDGTsYwn1228Pl7D4LJ49ju 13bRQVWJ6kCMJ6VSH1QcMIoxALVkyFH1wW+NLo2yOgcdT4rQDfmR1vxXR1BkF+ngo/mS FB7AxAUjSsC7TkniBcOvEaXoVJ/f0TZT8Ut3kaPs0O4/mHiRMoLeqAgotT54YSgQULr8 8ZBA== X-Gm-Message-State: AOAM530JheCTkJmtTTsfiUPoLVh6wpdEMyqD+eojzGTwd1HRQMS/9Hjs Obl44vtusquMMqzasPal2R3rXB5tDLLVqGaZTuNSjw== 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" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.