On May 31, 2025 3:23:04 AM PDT, Peter Zijlstra peterz@infradead.org wrote:
On Fri, May 30, 2025 at 10:48:47AM -0700, Kees Cook wrote:
On Fri, May 30, 2025 at 04:01:40PM +0200, Peter Zijlstra wrote:
I'm not really concerned with performance here, but more with the size of the code emitted by WARN_ONCE(). There are a *ton* of WARN sites, while only one report_bug() and printk().
The really offensive thing is that this is for a feature most nobody will ever need :/
Well, it won't be enabled often -- this reminds me of ftrace: it needs to work, but it'll be off most of the time.
Well, ftrace is useful, but when would I *ever* care about this stuff? I can't operate kunit, don't give a crap about kunit, and if I were to magically run it, I would be more than capable of ignoring WARNs.
It's not for you, then. :) I can't operate ftrace, but I use kunit almost daily. Ignoring WARNs makes this much nicer, and especially for CIs.
Cleaned it up a little bit... I'll add some comments on later :-)
I also need to go fix WARN_ONCE(), at least for the n<=2 cases that can use BUGFLAG_ONCE now.
Cool! I'll expand the WARN tests in LKDTM so we can get wider behavioral and architectural coverage.
-Kees