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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A9660C433EF for ; Fri, 15 Apr 2022 19:16:44 +0000 (UTC) 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:Mime-Version:References:In-Reply-To: Message-Id:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+SLox7nDv7GZc+TXIM0McsU2pDuXAAgT0l2bVkVYKy4=; b=r+FKeeM1OIJiux 5oCdEy4Rl1nasFX6ZMm3oPMJ9NigMVVFYhlpryNUEsxyHxyK0hXBOKXbHjk1cYUxWJ5Vrg/xztKtD 1tpoShQB23VeVNXewhizI1duql6XQS3jrFPP1ncWozkUBjM4xdoLJfUuL3e69U55tcnKOKVjHwzfG zEC9XErIcI1rMh7GzXOcH7GRuqytit6KYYTQJ4Wi4IbRDdX3+Z5WkbCpdpNhwNxx4PhlJL4/mUqgw QfKwUQG85KeIgCxBuFJbMNSFgFOximTk0tgerD96IgtoVwIlrUn4EhrsPptby8repELU5MMMvJRKo DisWTr2aRbMtBzFpvwQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfRPk-00BAR4-Vt; Fri, 15 Apr 2022 19:15:29 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfRPh-00BAQ5-Vd for linux-arm-kernel@lists.infradead.org; Fri, 15 Apr 2022 19:15:27 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220415_121526_139504_22B682E7 X-CRM114-Status: GOOD ( 22.84 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel