From: Peter Zijlstra <peterz@infradead.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH 2/2] Fix SCHED_WARN_ON()
Date: Tue, 28 Oct 2025 19:45:37 +0100 [thread overview]
Message-ID: <20251028184537.GC3419281@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20251028165059.682306-3-bvanassche@acm.org>
On Tue, Oct 28, 2025 at 09:50:58AM -0700, Bart Van Assche wrote:
> SCHED_WARN_ON() uses WARN_ONCE() and WARN_ONCE() uses printk(). Using
> printk() from certain code paths in the process scheduler is not allowed
> because printk() acquires the console_lock and this may cause printk()
> to sleep. Sleeping is not allowed from many paths in the process
> scheduler. Hence make sure that SCHED_WARN_ON() uses printk_deferred()
> instead of printk().
Yeah, so no. I hate that deferred thing with a passion. It means your
warning will never make it out if something fatal happens.
The printk() people have been working on fixing this for a long while
and I think they're close. All the crap consoles will get threaded
printing while the useful consoles (serial) will get atomic printing.
Also, you should never hit these WARNs to begin with, and if you do,
that lockdep splat is the least of your problems.
next prev parent reply other threads:[~2025-10-28 18:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 16:50 [PATCH 0/2] Restore and fix SCHED_WARN_ON() Bart Van Assche
2025-10-28 16:50 ` [PATCH 1/2] Revert "sched/debug: Change SCHED_WARN_ON() to WARN_ON_ONCE()" Bart Van Assche
2025-10-28 16:50 ` [PATCH 2/2] Fix SCHED_WARN_ON() Bart Van Assche
2025-10-28 18:45 ` Peter Zijlstra [this message]
2025-10-28 18:50 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251028184537.GC3419281@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bvanassche@acm.org \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox