From: Petr Mladek <pmladek@suse.com>
To: Aaron Tomlin <atomlin@atomlin.com>
Cc: akpm@linux-foundation.org, peterz@infradead.org,
rostedt@goodmis.org, senozhatsky@chromium.org, neelx@suse.com,
sean@ashe.io, rishil1999@outlook.com,
linux-kernel@vger.kernel.org,
"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
john.ogness@linutronix.de
Subject: Re: [RFC PATCH] panic, printk, sys_info: Introduce crash_kexec_in_memory_sys_info
Date: Tue, 22 Sep 2026 17:29:45 +0200 [thread overview]
Message-ID: <arKe6WiDWKpv-_S3@pathway.suse.cz> (raw)
In-Reply-To: <20260916201546.661384-1-atomlin@atomlin.com>
Adding Guilherme and John into Cc.
On Wed 2026-09-16 16:15:46, Aaron Tomlin wrote:
> When investigating kernel panics, capturing post-mortem diagnostic
> telemetry (e.g. memory zone metrics, lock states, active timers, and
> blocked tasks) is vital for root-cause analysis.
>
> While crash_kexec_post_notifiers allows executing panic notifiers and
> sys_info() before jumping to the kdump kernel, it is frequently avoided
> in production environments due to the risk of watchdog timeouts induced
> by synchronous hardware console emission.
There seems to be various motivations to set/clear
crash_kexec_post_notifiers.
Guilherme wanted to add some filtering because some notifiers
were failing, see
see https://lore.kernel.org/all/20220108153451.195121-1-gpiccoli@igalia.com/
I believe that they are called after kdump by default because
the information provided by them is included in the dump.
This idea is supported by the commit f06e5153f4ae2e2f3
("kernel/panic.c: add "crash_kexec_post_notifiers" option
for kdump after panic_notifers").
On the other hand, crash_kexec_post_notifiers is explicitely when
the kernel is running on some hypervisors because the hypervisors
need to get notified about the panic() before crash dump.
All I want to say is that the situation around
crash_kexec_post_notifiers is much more complicated. And I hear
about the watchdog timeouts in this context for the first time.
> To resolve this dilemma, introduce the crash_kexec_in_memory_sys_info
> boot parameter. When enabled, it captures diagnostic telemetry directly
> into the printk ring buffer entirely in RAM before jumping to
> __crash_kexec(), completing in milliseconds rather than tens of seconds.
>
> To make this safe, fast, and reliable without risking buffer overflow:
> 1. Scoped console flush suppression
>
> Provide printk_suppress_console_flush(bool) to clear the console
> flush mask in printk_get_console_flush_type(). Messages written
> via vprintk_store() remain in the printk ring buffer in memory
> and avoid synchronous hardware console emission and waking
> kthreads.
This might help when the claim about watchdog reports is true.
I am not sure about it. Anyway, there are other ways how to
prevent watchdogs stepping in (touching them, disabling them, ...)
The console output is important when the crashdump fails.
> 2. Scoped ring buffer tail freezing
>
> Introduce printk_freeze_tail(bool) in printk_ringbuffer. When
> active, desc_push_tail() and data_push_tail() refuse to advance
> the tail. If diagnostic logging exhausts available ring buffer
> headroom, new records are safely dropped, guaranteeing that the
> initial panic Oops, faulting registers, and primary stack trace
> are never overwritten.
This is another questionable feature. The ring buffer would need to be
super big to hold all messages since the boot. IMHO, servers are
normally running hundreds of days and the log buffer gets rotated,
like the user space logs, ...
> 3. Execution sequence reordering
>
> Reorder __sys_info() so compact, high-signal subsystems (e.g.
> memory) are collected first, leaving high-volume dumps (all CPU
> backtraces, full task lists, and ftrace) for last.
This might make sense. I am just afraid that it might be a personal
opinion and we might end up with an endless shuffling here.
My opinion:
IMHO, it does not make much sense to dump sys_info() before kdump
and block consoles. The information is lost when kdump fails.
The information can be extracted from the crashdump when
kdump succeeds.
Best Regards,
Petr
prev parent reply other threads:[~2026-09-22 15:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 20:15 Aaron Tomlin
2026-09-16 20:50 ` Bradley Morgan
2026-09-22 15:29 ` 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=arKe6WiDWKpv-_S3@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=akpm@linux-foundation.org \
--cc=atomlin@atomlin.com \
--cc=gpiccoli@igalia.com \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=neelx@suse.com \
--cc=peterz@infradead.org \
--cc=rishil1999@outlook.com \
--cc=rostedt@goodmis.org \
--cc=sean@ashe.io \
--cc=senozhatsky@chromium.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®