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 EFA4FC433EF for ; Fri, 15 Apr 2022 19:15:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 66A846B0072; Fri, 15 Apr 2022 15:15:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F2596B0073; Fri, 15 Apr 2022 15:15:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 493EB6B0074; Fri, 15 Apr 2022 15:15:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 38E476B0072 for ; Fri, 15 Apr 2022 15:15:26 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 08564256C1 for ; Fri, 15 Apr 2022 19:15:26 +0000 (UTC) X-FDA: 79360067052.20.677E42D Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf17.hostedemail.com (Postfix) with ESMTP id 5BC6C40005 for ; Fri, 15 Apr 2022 19:15:25 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 24BD361BB5; Fri, 15 Apr 2022 19:15:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2534C385A5; Fri, 15 Apr 2022 19:15:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1650050123; bh=s9C8faIK00xt2+0wVedQjvZhl8ZJTVhHLnw3heyEu+M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=n9y0C56ItXZ6xpNq/g2dEU0MMwPVCIqzYqUviq3BiqGuyOlvqC3EoUKF/0oInwbVf SFi471arNEwMtWyXZuITw10ESGMeic7mS4iX63OYEkT4VdPVoTl5TdPvK0MZ7lPXaa 1M7XBEfatPouaHlItxQ21PVYu5o5PQvtdvC80rBg= Date: Fri, 15 Apr 2022 12:15:21 -0700 From: Andrew Morton To: Yu Zhao Cc: Stephen Rothwell , Linux-MM , Andi Kleen , Aneesh Kumar , Barry Song <21cnbao@gmail.com>, Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Johannes Weiner , Jonathan Corbet , Linus Torvalds , Matthew Wilcox , Mel Gorman , Michael Larabel , Michal Hocko , Mike Rapoport , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , Linux ARM , "open list:DOCUMENTATION" , linux-kernel , Kernel Page Reclaim v2 , "the arch/x86 maintainers" , Brian Geffon , Jan Alexander Steffens , Oleksandr Natalenko , Steven Barrett , Suleiman Souhlal , Daniel Byrne , Donald Carr , Holger =?ISO-8859-1?Q?Hoffst=E4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh , Vaibhav Jain Subject: Re: [PATCH v10 08/14] mm: multi-gen LRU: support page table walks Message-Id: <20220415121521.764a88dda55ae8c676ad26b0@linux-foundation.org> In-Reply-To: References: <20220407031525.2368067-1-yuzhao@google.com> <20220407031525.2368067-9-yuzhao@google.com> <20220411191621.0378467ad99ebc822d5ad005@linux-foundation.org> <20220414185654.e7150bcbe859e0dd4b9c61af@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 5BC6C40005 X-Stat-Signature: qpohxdg5ewg55re8t7qmbzwbgjzzd5pd Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=n9y0C56I; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-HE-Tag: 1650050125-29361 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 Fri, 15 Apr 2022 00:25:45 -0600 Yu Zhao wrote: > On Thu, Apr 14, 2022 at 7:57 PM Andrew Morton wrote: > > > > On Thu, 14 Apr 2022 19:14:54 -0600 Yu Zhao wrote: > > > > > On Mon, Apr 11, 2022 at 8:16 PM Andrew Morton wrote: > > > > > > > > On Wed, 6 Apr 2022 21:15:20 -0600 Yu Zhao wrote: > > > > > > > > > +static void update_batch_size(struct lru_gen_mm_walk *walk, struct folio *folio, > > > > > + int old_gen, int new_gen) > > > > > +{ > > > > > + int type = folio_is_file_lru(folio); > > > > > + int zone = folio_zonenum(folio); > > > > > + int delta = folio_nr_pages(folio); > > > > > + > > > > > + VM_BUG_ON(old_gen >= MAX_NR_GENS); > > > > > + VM_BUG_ON(new_gen >= MAX_NR_GENS); > > > > > > > > General rule: don't add new BUG_ONs, because they crash the kenrel. > > > > It's better to use WARN_ON or WARN_ON_ONCE then try to figure out a way > > > > to keep the kernel limping along. At least so the poor user can gather logs. > > > > > > These are VM_BUG_ONs, which are BUILD_BUG_ONs except for (mostly MM) developers. > > > > I'm told that many production builds enable runtime VM_BUG_ONning. > > Nobody wants to debug VM in production. Some distros that offer both > the latest/LTS kernels do enable CONFIG_DEBUG_VM in the former so the > latter can have better test coverage when it becomes available. Do > people use the former in production? Absolutely, otherwise we won't > have enough test coverage. Are we supposed to avoid CONFIG_DEBUG_VM? I > don't think so, because it defeats the purpose of those distros > enabling it in the first place. > > The bottomline is that none of RHEL 8.5, SLES 15, Debian 11 enables > CONFIG_DEBUG_VM. I grabbed https://kojipkgs.fedoraproject.org//packages/kernel/5.18.0/0.rc2.23.fc37/src/kernel-5.18.0-0.rc2.23.fc37.src.rpm and hp2:/home/akpm/yy> grep "DEBUG_VM[= ]" *.config kernel-aarch64-debug-fedora.config:CONFIG_DEBUG_VM=y kernel-aarch64-debug-rhel.config:# CONFIG_DEBUG_VM is not set kernel-aarch64-fedora.config:CONFIG_DEBUG_VM=y kernel-aarch64-rhel.config:# CONFIG_DEBUG_VM is not set kernel-armv7hl-debug-fedora.config:CONFIG_DEBUG_VM=y kernel-armv7hl-fedora.config:CONFIG_DEBUG_VM=y kernel-armv7hl-lpae-debug-fedora.config:CONFIG_DEBUG_VM=y kernel-armv7hl-lpae-fedora.config:CONFIG_DEBUG_VM=y kernel-ppc64le-debug-fedora.config:CONFIG_DEBUG_VM=y kernel-ppc64le-debug-rhel.config:CONFIG_DEBUG_VM=y kernel-ppc64le-fedora.config:CONFIG_DEBUG_VM=y kernel-ppc64le-rhel.config:# CONFIG_DEBUG_VM is not set kernel-s390x-debug-fedora.config:CONFIG_DEBUG_VM=y kernel-s390x-debug-rhel.config:CONFIG_DEBUG_VM=y kernel-s390x-fedora.config:CONFIG_DEBUG_VM=y kernel-s390x-rhel.config:# CONFIG_DEBUG_VM is not set kernel-s390x-zfcpdump-rhel.config:# CONFIG_DEBUG_VM is not set kernel-x86_64-debug-fedora.config:CONFIG_DEBUG_VM=y kernel-x86_64-debug-rhel.config:CONFIG_DEBUG_VM=y kernel-x86_64-fedora.config:CONFIG_DEBUG_VM=y kernel-x86_64-rhel.config:# CONFIG_DEBUG_VM is not set