Thread (39 messages) flat view 39 messages, 9 authors, 2019-11-15

Re: [PATCH 00/50] Add log level to show_stack()

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2019-11-13 20:06:23
Also in: linux-alpha, linux-riscv, linux-um

On Wed, 6 Nov 2019 23:25:13 +0000
Russell King - ARM Linux admin [off-list ref] wrote:
On Wed, Nov 06, 2019 at 09:34:40PM +0100, Peter Zijlstra wrote:
quoted
I suppose I'm surprised there are backtraces that are not important.
Either badness happened and it needs printing, or the user asked for it
and it needs printing.  
Or utterly meaningless.
quoted
Perhaps we should be removing backtraces if they're not important
instead of allowing to print them as lower loglevels?  
Definitely!  WARN_ON() is well overused - and as is typical, used
without much thought.  Bound to happen after Linus got shirty about
BUG_ON() being over used.  Everyone just grabbed the next nearest thing
to assert().

As a kind of example, I've recently come across one WARN_ON() in a
driver subsystem (that shall remain nameless at the moment) which very
likely has multiple different devices on a platform.  The WARN_ON()
triggers as a result of a problem with the hardware, but because it's a
WARN_ON(), you've no idea which device has a problem.  The backtrace is
mostly meaningless.  So you know that a problem has occurred, but the
kernel prints *useless* backtrace to let you know, and totally omits
the *useful* information.
I would like to bring up a topic for the next maintainers summit
(although I may not even be there), that we define a clear use of
WARN_ON(). I use it only if the code does something I do not expect it
to do, and is considered a bug in the code if it triggers. But it
appears that some drivers use it for "oh I didn't realize this hardware
does something I didn't expect". And is ignored when the warn on is
triggered and reported, with "you have buggy hardware" but my hardware
appears to work just fine!

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help