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 789B6C433F5 for ; Fri, 15 Apr 2022 20:12:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D5206B0072; Fri, 15 Apr 2022 16:12:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 95C536B0073; Fri, 15 Apr 2022 16:12:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7AE7B6B0074; Fri, 15 Apr 2022 16:12:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 647A06B0072 for ; Fri, 15 Apr 2022 16:12:11 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 300ED256EC for ; Fri, 15 Apr 2022 20:12:11 +0000 (UTC) X-FDA: 79360210062.07.956454D Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) by imf16.hostedemail.com (Postfix) with ESMTP id A6517180006 for ; Fri, 15 Apr 2022 20:12:10 +0000 (UTC) Received: by mail-vs1-f50.google.com with SMTP id j16so7853307vsv.2 for ; Fri, 15 Apr 2022 13:12:10 -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=77JRexCHO+Dta+d2jV7L61UaG98jtgCgEk5PjH0Qclw=; b=bSiip5XBN84sfc8EAMqB+8gWFrwJVQUR5v12Hj7kiLzo35u6nluGLhefFhs00QbZRR HT4dBU715eLd92x4QRczO0YgkhjNxz3mbNszIssovkBmykUjqSngT3NhjHLZppusWtw2 3VOElStHDME19hWWY/06fkmPmCkj5TnXUWGNcJQXPiJhcRrGDX5PvA5W08q9+LL7+ZMB C5beDV70lv/ySj0n0+lK3jQG8IwFVL1pffbX7W9VSy4IFCCsXe/mWHDHkdzqPIAHcSfV qLrxfXPGfbXfENwPzH7NDV5JMI1paK0Thm/w2BDYLElxNTp4+B8HZdGbZSMnPMcpSwlV c0rQ== 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=77JRexCHO+Dta+d2jV7L61UaG98jtgCgEk5PjH0Qclw=; b=L0LvefZyrR3B/cnkcJwOu0JkI45diPSpP+BqXRH0NaVYZ3HyBKB111dowfNR8WQesT csFhr1ZACBqg0Nz77ywrujQdU3qq5fJUcZ8YnAfgHIjAFjGZ8aT3vGP/WfgAggKR13q/ eebR+fzcDyzikx3PGq19HLSrlRHiov5yvRJuMTwdKngu3VaXGXxJGV8Jv1LOPgOhJkSk BsYZo5VsWdYEHi69UNbIUX6y5CQV5ks+j2HYSqgkWrb4RVy2QKffxT2aA0inlJkC01u6 Zda9S/Qzq2+NfNjQAn/Wc1LX6zITbbYyJeufqLVM3m9ZORVsOyFnUUrgpsvLFPNnNUWm T5LA== X-Gm-Message-State: AOAM531c/VJeVfpHR3qfI+Sa/udzBufWGV4+9aKHTKQnZjyNosNGNzwV JG+a/2zKRxzQxvKl2iklprPYBXj3ieE7v08zQsO1lA== X-Google-Smtp-Source: ABdhPJykqcrKHyXgb08sa7ibqLGNVlW1gdYVPxs3ydRjRchU0Lalyvg1ICTkwCfmsXRhMCN3MYBNGKoe6YsDKcJnXHw= X-Received: by 2002:a05:6102:5cc:b0:320:9bd2:3823 with SMTP id v12-20020a05610205cc00b003209bd23823mr192562vsf.81.1650053529747; Fri, 15 Apr 2022 13:12:09 -0700 (PDT) MIME-Version: 1.0 References: <20220407031525.2368067-1-yuzhao@google.com> <20220407031525.2368067-9-yuzhao@google.com> <20220411191621.0378467ad99ebc822d5ad005@linux-foundation.org> <20220414185654.e7150bcbe859e0dd4b9c61af@linux-foundation.org> <20220415121521.764a88dda55ae8c676ad26b0@linux-foundation.org> In-Reply-To: <20220415121521.764a88dda55ae8c676ad26b0@linux-foundation.org> From: Yu Zhao Date: Fri, 15 Apr 2022 14:11:32 -0600 Message-ID: Subject: Re: [PATCH v10 08/14] mm: multi-gen LRU: support page table walks To: Andrew Morton , Justin Forbes 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 , =?UTF-8?Q?Holger_Hoffst=C3=A4tte?= , Konstantin Kharlamov , Shuang Zhai , Sofia Trinh , Vaibhav Jain Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=bSiip5XB; spf=pass (imf16.hostedemail.com: domain of yuzhao@google.com designates 209.85.217.50 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: b9hpjhytm3ptcuj63e67tkb4rdn444ee X-Rspamd-Queue-Id: A6517180006 X-Rspamd-Server: rspam04 X-Rspam-User: X-HE-Tag: 1650053530-9909 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, Apr 15, 2022 at 1:15 PM Andrew Morton wrote: > > 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 Yes, Fedora/RHEL is one concrete example of the model I mentioned above (experimental/stable). I added Justin, the Fedora kernel maintainer, and he can further clarify. If we don't want more VM_BUG_ONs, I'll remove them. But (let me reiterate) it seems to me that just defeats the purpose of having CONFIG_DEBUG_VM. > 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