Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3671795rwd; Mon, 22 May 2023 18:31:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72UN1Ob4murS45XzQ23Uq6eGFjBtg445eq5fkALgt3HR8+xQjIDSqnabLx0zFU0/JSRkU4 X-Received: by 2002:a05:6a20:12cb:b0:10b:d3e0:78a7 with SMTP id v11-20020a056a2012cb00b0010bd3e078a7mr4667264pzg.61.1684805469340; Mon, 22 May 2023 18:31:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684805469; cv=none; d=google.com; s=arc-20160816; b=kT/Hc6vKllm0fA0Vpu5521M9jFq1h8m2qtliXbBk6en3l89i92JXqyOnD/N5AQlpOW VZujASjfum2VUrBB/u7oeG2Luq1hrKgSvcQ9O3YlUaUfgI2U9EjMjta7HB7g1WZSc1xX U/lKdzVUFm9C7BF/Z2ZvP2Ziv7MoxSiKFWDUwoNLfrFZ7usDsMglw7IWaBLFbYWzLQa3 9bqkf5egCsKx55IuBvo+yLMGa2KGqouEI6u6PA8Z1T6QbWC75nG5uwaxcazHBE+r9akc 3nvkaEH9Sf5i4oiw/HLb40mmZ3oMtinp/npyw0B3J/5RG6AbJ6HxTHvfwUxGNF2Snsqs 7Www== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=0t+3evlCLlh8Vv6Mnjo2JSq0Q8GfskIouq/uyhSRTHA=; b=FkQDRVglyciReQWMrmk/S6RpU/IYEBvm4som/mLqL/tP8Hgp6X7qNJYCbxqiDfLpTJ ipXAViA+JRNXJ3/28uz8RjLtw/JLw7wm+VOd3lu+4F0gwJ0DaommXf7iZZfSiWfMLDiQ f7qUvFQEgaqyI2qRak5yM5Sp95tnOgNVOzARa9nqMCmN26G2DRwzaJrloiKaMECGa2zD P42iFxacl8MYvOtgSTNXZ8yrozOa81YeAoT/pQmt+LnRjHJ43reV+eyUVt80mAs/J250 0o/hVnAapfQDta5vclqGy+eWBKzR/y2kelOvnrMd5Yn1IRO1Cg+dlHWRomXoA8TcXGfG Reiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=l0s1tfsB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y186-20020a638ac3000000b0053eef60f940si461823pgd.765.2023.05.22.18.30.54; Mon, 22 May 2023 18:31:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=l0s1tfsB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235222AbjEWA5o (ORCPT + 99 others); Mon, 22 May 2023 20:57:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235199AbjEWA5S (ORCPT ); Mon, 22 May 2023 20:57:18 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69E0E270A for ; Mon, 22 May 2023 17:53:13 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1ae3f74c98bso40955ad.1 for ; Mon, 22 May 2023 17:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684803121; x=1687395121; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=0t+3evlCLlh8Vv6Mnjo2JSq0Q8GfskIouq/uyhSRTHA=; b=l0s1tfsBkLul0R6dsA3XF8f9SMtZBnuThFwzCYzha5dJkSxN+5/cO73DPsm5Gs+psh /PNQHyOsLqxoSCW3GqyV4R6dpa4BX7UiSKkWKNKBZKjwdQLyewJvBTpESXsAUHY9L5HX NGn7zMYU7cBaGQH/pLOztrjas6T2eu3BjvTy8MeCa3xXd8fzPPEgOh6YnOEbMlYqHOvU aboAd0tWpjiN165/faQOf4W0GXsyLoFZtsSwZd5WUVV10m1vkLtxCRzsmxm51qxscfUC 9dSkcrdsgWvXmvpk2aqXGvY02KRADCtt3gFRPWrK3O4kpdFgTmtMN2TAN2NEX/vIc7V1 ZPPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684803121; x=1687395121; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0t+3evlCLlh8Vv6Mnjo2JSq0Q8GfskIouq/uyhSRTHA=; b=ZODDEvIPAcnbQSE5UkJr1T6JNKKUUZs+ABkorS6KjT9wUMrT1NHfeZbq2EoHkHMvvn UwHJ21wnPqk4nnQp0p+YdtmhzmyQhs4wVWVYUzn/Lx//7XbRYYJ3IjvnQzmY853JYjoC 60WfiFMZn8ceLjEOhF3rCdLuWPnlWTv1inc3MXxYSIJLUExLK2qFr278MWXUw5q+SEL6 cM5KcKA7ZeS/tPpMS1olJFaZlvFh83VNQYqH95H3umSw3/zvaRAB0Kc3oIkU5fOwFYYv d5qd1piBRLzowRoRy8tnUUq2sQH5FkZl4zSiMEQZRc+pk5oOvBnP0bPen6r82/PteutL Uu/g== X-Gm-Message-State: AC+VfDysKX4Xw9CNkEuNOfL+64hF74XsMqeXAQJZp4mpXXBhq1wZ3feg V8ATI83n7fym0FNrwkp8Q6oFfA== X-Received: by 2002:a17:902:e74e:b0:1a8:96c:738 with SMTP id p14-20020a170902e74e00b001a8096c0738mr159173plf.2.1684803121320; Mon, 22 May 2023 17:52:01 -0700 (PDT) Received: from [2620:0:1008:11:2b0e:a3da:5943:182] ([2620:0:1008:11:2b0e:a3da:5943:182]) by smtp.gmail.com with ESMTPSA id h7-20020a170902f7c700b001a19196af48sm5428262plw.64.2023.05.22.17.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 17:52:00 -0700 (PDT) Date: Mon, 22 May 2023 17:51:59 -0700 (PDT) From: David Rientjes To: Linus Torvalds cc: David Hildenbrand , Andrew Morton , Michal Hocko , Alex Shi , Johannes Weiner , Matthew Wilcox , Alexander Duyck , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] mm, debug: allow suppressing panic on CONFIG_DEBUG_VM checks In-Reply-To: Message-ID: References: <53dd9df8-e88f-f466-89f9-3fa141a10267@google.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2003089352-356300863-1684803120=:4168530" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2003089352-356300863-1684803120=:4168530 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Mon, 22 May 2023, Linus Torvalds wrote: > On Mon, May 22, 2023 at 11:39 AM David Rientjes wrote: > > > > I think VM_BUG_ON*() and friends are used to crash the kernel for > > debugging so that we get a crash dump and because some variants don't > > exist for VM_WARN_ON(). > > I do think that from a VM developer standpoint, I think it should be > fine to just effectively turn VM_BUG_ON() into WARN_ON_ONCE() together > with panic_on_warn. > > Maybe we could even extend 'panic_on_warn' to be a bitmap and > effectively have a "don't panic on non-VM warnings" option. > I hadn't thought of that approach, it would definitely help us achieve our goal of emitting warnings on a small set of production hosts that we don't want to crash. It's also very clean. Right now kernel.panic_on_warn can either be 0 or 1. We can keep the lowest bit to be "panic on all warnings" and then bit-1 as "panic on debug VM warnings." When CONFIG_DEBUG_VM is enabled, set the new bit by default so there's no behavior change. Then, we can keep VM_BUG_ON*() and friends around and extend them to check whether they should BUG() after the WARN_ON(1) or not. On our production hosts, we'll just set kernel.panic_on_oom to 0. I'll give it a few days to see if anybody else has any comments or concerns; if not, I'll send a v2 based on this. --2003089352-356300863-1684803120=:4168530--