Re: [PATCH 1/2] bug: Provide WARN_ON.*DEFERRED() macros for console deferred output
From: Sebastian Andrzej Siewior
Date: Wed Jun 24 2026 - 07:03:49 EST
On 2026-06-24 01:37:53 [-0700], Breno Leitao wrote:
Hi Breno,
> Have you considered an approach similar to printk_deferred_enter(),
> where you mark the code region that needs deferral and all WARN() calls
> within that region are automatically deferred?
Doing this at rq-lock site is not something the scheduler department
takes. It increases/ bloats the code sides more than what we have now.
Not everything is in __sched section so we can't check for this from
within printk. So this turd was the only idea I had.
> The current proposal requires changing individual WARN() call sites,
> but whether they need deferral might depend on the calling context. This
> means you'd need to convert many call sites and ensure all nested
> warnings are also converted to the deferred variant.
I hope for the forced-threaded-legacy the default but this camp has not
a lot members. It would increase the pressure to provide nbcon so it
could be a good thing.
To accept this series and make it more bullet-proof we could do
s/WARN_ON\>/WARN_ON_DEFERRED/ for all sched/ and require it regardless
if the rq-lock is held. So you wouldn't have to audit it each and every
time. Due to that preempt-disable thingy it can be used in preemptible
sections without breaking anything.
>
> Thanks,
> --breno
Sebastian