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 E45CBC433F5 for ; Fri, 15 Apr 2022 01:57:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344215AbiDOB71 (ORCPT ); Thu, 14 Apr 2022 21:59:27 -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-doc@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.