Messages in this thread | | | Date | Tue, 14 Apr 2020 21:43:01 -0400 | From | Steven Rostedt <> | Subject | Re: [PATCH v3] Add kernel config option for tweaking kernel behavior. |
| |
On Tue, 14 Apr 2020 18:14:51 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:
> If that WARN_ON() is a problem, then the people behind it should be > appraised of it, and it should probably be removed. I'm assuming it > was some kind of "I don't think this can happen, so if it does, I want > to see how it happened" WARN_ON.
What I do (and feel everyone should too), is I only add a WARN_ON() when I check something that I believe *can't* happen. If the WARN_ON() triggers, it either means that there's a bug in the code (and needs a fix), or the code design changed, in which case the WARN_ON() should be either removed, or that code updated to handle the new change.
In any case, a WARN_ON() should always be investigated when hit.
The only time I've had issues with people is when I have some hardware (i915) that triggers a WARN_ON() and I'm told that my hardware is buggy (or I need a firmware update). In which case, I just manually remove the WARN_ON() because the machine that triggers it is a test machine I don't have the time to waste updating firmware on.
-- Steve
| |