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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82FD2C4332F for ; Fri, 15 Apr 2022 01:57:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348542AbiDOB72 (ORCPT ); Thu, 14 Apr 2022 21:59:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345417AbiDOB71 (ORCPT ); Thu, 14 Apr 2022 21:59:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AE02B0D27; Thu, 14 Apr 2022 18:57:00 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id EA5B5B82BE8; Fri, 15 Apr 2022 01:56:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EED4CC385A5; Fri, 15 Apr 2022 01:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1649987817; bh=ysnJvJIjZnyxWKZuaQD4LsgYeCMzMSJq6bj2UggluuM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KScx2dLZArE6eYk81pk/lFBIfXKqb0xej5bLwVJZ2U1ypZzz63FJtTcE1PViKwtlI bn5liD8s3f5BQWa/2LQSwPj5cwH8Izf7z+YmG+S0KhA13IPHRld2oDbVjovhfIbvD9 YL8p0jxgE4cK1JbgeRGlbwvxLsGMbTvCXG9UNhz8= Date: Thu, 14 Apr 2022 18:56:54 -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: <20220414185654.e7150bcbe859e0dd4b9c61af@linux-foundation.org> In-Reply-To: References: <20220407031525.2368067-1-yuzhao@google.com> <20220407031525.2368067-9-yuzhao@google.com> <20220411191621.0378467ad99ebc822d5ad005@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 7119BC433EF for ; Fri, 15 Apr 2022 01:58:40 +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=+8TPWarM3B4RAZChrjhC5smupVRJuvARuQjOTqHige0=; b=wkTUdeZr9zAzJi t9Rj18ls0480lJ/VJh+0qSkYVvwClFsKv+SKqrUxhmK9/IRSG12s7cMg2nuFi5LvKOaXdczYXpU2F +SVgOqS4A2swn812LB2Al0hF5a7SoKuhPIb6SCribqbEDF5OXxs9pg/qW52TOBUGmaIsF3IrVl/y3 GPmPHtTWkF0tir3GW7Gholf6AMzW6+EFKk0oN+FJzGSRkryGPQZ/C7DnaoXaNnaYq6HetTB0NYZVY MeycYDToyNPt6gPamCSZOxLyXs1tJ1xb3LLLXG4vAa43oXihC+PIKXd9+V9GrSJkURW9jV3OPQ1Qh JS+qxTMSsrEozP7/eyLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfBCs-0083U2-0r; Fri, 15 Apr 2022 01:57:06 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfBCn-0083S9-Lp for linux-arm-kernel@lists.infradead.org; Fri, 15 Apr 2022 01:57:03 +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 ams.source.kernel.org (Postfix) with ESMTPS id D0B14B82B5F; Fri, 15 Apr 2022 01:56:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EED4CC385A5; Fri, 15 Apr 2022 01:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1649987817; bh=ysnJvJIjZnyxWKZuaQD4LsgYeCMzMSJq6bj2UggluuM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KScx2dLZArE6eYk81pk/lFBIfXKqb0xej5bLwVJZ2U1ypZzz63FJtTcE1PViKwtlI bn5liD8s3f5BQWa/2LQSwPj5cwH8Izf7z+YmG+S0KhA13IPHRld2oDbVjovhfIbvD9 YL8p0jxgE4cK1JbgeRGlbwvxLsGMbTvCXG9UNhz8= Date: Thu, 14 Apr 2022 18:56:54 -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: <20220414185654.e7150bcbe859e0dd4b9c61af@linux-foundation.org> In-Reply-To: References: <20220407031525.2368067-1-yuzhao@google.com> <20220407031525.2368067-9-yuzhao@google.com> <20220411191621.0378467ad99ebc822d5ad005@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-20220414_185702_082038_F81C4027 X-CRM114-Status: GOOD ( 17.12 ) 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 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel