From: David Rientjes <rientjes@google.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Hildenbrand <david@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>, Alex Shi <alexs@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Matthew Wilcox <willy@infradead.org>,
Alexander Duyck <alexanderduyck@fb.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch] mm, debug: allow suppressing panic on CONFIG_DEBUG_VM checks
Date: Mon, 22 May 2023 17:51:59 -0700 (PDT) [thread overview]
Message-ID: <b2bf7ae9-983d-6c20-0781-7f37a4454bfd@google.com> (raw)
In-Reply-To: <CAHk-=wg+PHQ9PhTeQOb7Fh5Qf3zkzG5J1h3D=eOY-2AsYXhU4Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1363 bytes --]
On Mon, 22 May 2023, Linus Torvalds wrote:
> On Mon, May 22, 2023 at 11:39 AM David Rientjes <rientjes@google.com> 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.
next prev parent reply other threads:[~2023-05-23 0:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-21 23:07 [patch] mm, debug: allow suppressing panic on CONFIG_DEBUG_VM checks David Rientjes
2023-05-22 9:42 ` David Hildenbrand
2023-05-22 18:39 ` David Rientjes
2023-05-22 18:48 ` Linus Torvalds
2023-05-23 0:51 ` David Rientjes [this message]
2023-05-23 1:47 ` Linus Torvalds
2023-05-24 0:53 ` David Rientjes
2023-05-24 8:42 ` David Hildenbrand
2023-05-24 11:44 ` Justin Forbes
2023-05-23 7:46 ` Michal Hocko
2023-05-23 3:43 ` Matthew Wilcox
2023-05-24 0:54 ` David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b2bf7ae9-983d-6c20-0781-7f37a4454bfd@google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=alexanderduyck@fb.com \
--cc=alexs@kernel.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).