[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <29fb251b-4622-4eb6-538d-bab6ac6a76f6@nvidia.com>
Date: Sun, 28 Aug 2022 21:49:23 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Dave Young <dyoung@...hat.com>
Cc: David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-doc@...r.kernel.org,
kexec@...ts.infradead.org,
Andrew Morton <akpm@...ux-foundation.org>,
Ingo Molnar <mingo@...nel.org>,
David Laight <David.Laight@...lab.com>,
Jonathan Corbet <corbet@....net>,
Andy Whitcroft <apw@...onical.com>,
Joe Perches <joe@...ches.com>,
Dwaipayan Ray <dwaipayanray1@...il.com>,
Lukas Bulwahn <lukas.bulwahn@...il.com>,
Baoquan He <bhe@...hat.com>, Vivek Goyal <vgoyal@...hat.com>,
Stephen Johnston <sjohnsto@...hat.com>,
Prarit Bhargava <prarit@...hat.com>
Subject: Re: [PATCH RFC 1/2] coding-style.rst: document BUG() and WARN() rules
("do not crash the kernel")
On 8/28/22 20:07, Linus Torvalds wrote:
> On Sun, Aug 28, 2022 at 6:56 PM Dave Young <dyoung@...hat.com> wrote:
>>
>>> John mentioned PANIC_ON().
>>
>> I would vote for PANIC_ON(), it sounds like a good idea, because
>> BUG_ON() is not obvious and, PANIC_ON() can alert the code author that
>> this will cause a kernel panic and one will be more careful before
>> using it.
>
> People, NO.
>
> We're trying to get rid of BUG_ON() because it kills the machine.
>
> Not replace it with another bogus thing that kills a machine.
OK, this guidance, and the write-up that follows it, is all very clear,
except for one point...
>
> So no PANIC_ON(). We used to have "panic()" many many years ago, we
> got rid of it. We're not re-introducing it.
...here. I count ~1000 calls to panic() in today's kernel, to a
function in kernel/panic.c that shows no hint of being removed, nor
even deprecated.
$ git grep -nw panic\( | wc -l
1321
Could you please clarify that point? (I'm not trying to debate
policy, but rather, to figure out what we should write in the
documentation of the policy.)
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists