From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Breno Leitao <leitao@debian.org>,
Andrew Morton <akpm@linux-foundation.org>,
Alexander Potapenko <glider@google.com>,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Marco Elver <elver@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
Vlastimil Babka <vbabka@kernel.org>,
kasan-dev@googlegroups.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kernel-team@meta.com,
Toshiyuki Sato <fj6611ie@aa.jp.fujitsu.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] stackdepot: don't WARN when the depot runs out of pools
Date: Wed, 4 Nov 2026 10:19:41 +0100 [thread overview]
Message-ID: <aur4rU-I1BhxrxYK@pathway.suse.cz> (raw)
In-Reply-To: <87wlqtxb14.fsf@jogness.linutronix.de>
On Wed 2026-11-04 09:26:55, John Ogness wrote:
> On 2026-11-03, Breno Leitao <leitao@debian.org> wrote:
> > That deferral only applies to legacy consoles. ON nbcon WARN() puts the
> > CPU in emergency mode, and in emergency mode printk() flushes all
> > pending records to the nbcon consoles from the calling context.
>
> Yes. WARN() is supposed to be for critical issues.
I thought whether it is fine that NBCON consoles ignored printk
deferred context. I could imagine that WARN() is used just to
generate the backtrace but the message itself is not that critical.
Well, it was added to the stackdepot code by the commit a914d8d6cf204287aa
("lib/stackdepot: add printk_deferred_enter/exit guards"). And the
reason was to avoid deadlocks in the console code. And the deadlock
is prevented in the NBCON code by using try_lock approach. So that
NBCON consoles do not need to be deferred to prevent deadlocks.
And if anyone wants a less critical backtrace then we should introduce
another API for this, e.g. INFO().
> > With
> > a slow serial console (pl011 is an nbcon console) and a backlog of
> > messages, that flush can outlast the hard lockup threshold, all of it
> > with pool_lock held and IRQs disabled, while every other CPU that needs
> > to save a new stack trace spins on pool_lock.
>
> Several serial drivers call touch_nmi_watchdog() (such as 8250) to avoid
> this issue. Perhaps the pl011 should be doing this as well (at least for
> the write_atomic() path)?
I agree that it would make sense.
> > Running out of depot space is an expected condition under heavy debug
> > load, not a kernel bug, so report it with pr_warn_once() instead.
>
> This is the key takeaway. WARN() is not appropriate here.
I agree:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
prev parent reply other threads:[~2026-11-04 9:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 11:01 Breno Leitao
2026-11-03 12:19 ` Marco Elver
2026-11-04 8:20 ` John Ogness
2026-11-04 9:19 ` Petr Mladek [this message]
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=aur4rU-I1BhxrxYK@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=fj6611ie@aa.jp.fujitsu.com \
--cc=glider@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.ogness@linutronix.de \
--cc=kasan-dev@googlegroups.com \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ryabinin.a.a@gmail.com \
--cc=vbabka@kernel.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
all inboxes | Powered by JetHome®