From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Breno Leitao <leitao@debian.org>,
Ryan Roberts <ryan.roberts@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Rio <rioo.tsukatsukii@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v1] panic: Flush unsafe consoles before panic reboot
Date: Thu, 5 Nov 2026 17:50:52 +0100 [thread overview]
Message-ID: <auyz7JPCK7K9QFT_@pathway.suse.cz> (raw)
In-Reply-To: <8733tgc0b5.fsf@jogness.linutronix.de>
On Wed 2026-11-04 12:24:06, John Ogness wrote:
> On 2026-11-03, Petr Mladek <pmladek@suse.com> wrote:
> >> I can accept this, since legacy-netconsole had these risks anyway. My
> >> only concern is when we add an interface for the unsafe flushing policy,
> >> will we continue to have unsafe flushing be the default for netconsole?
> >> I guess we would need to keep it the same to avoid regressions (just as
> >> we need to have it on by default now).
> >
> > Good point. I think that this basically goes down to the question
> > whether we would later introduce an option:
> >
> > --panic-focus-on-debug or --panic-focus-on-reboot
> >
> > The current state is somewhere in the middle. I would say
> > that:
> >
> > + the legacy consoles are more focusing on the debugging side
> > because bust_spinlocks() is called early. And
> > console_flush_on_panic() is called before emergency_restart().
> >
> > + the nbcon console are more focusing on safe reboot because
> > nbcon_atomic_flush_unsafe() is called only when followed
> > by an infinite diod blinking.
>
> Note that this difference between legacy and nbcon was one of the
> primary design goals for nbcon. It is not chance that we are avoiding
> "hope and pray mode".
>
> > It looked like the nbcon handling was good enough before
> > we added netconsole with an unsafe write_atomic. And maybe
> > even before converting the widely used uart 8250 serial
> > console driver.
> >
> > People started complaining about missing messages with
> > the converted netconsole and uart 8250 drivers. The current
> > nbcon handling looks like a regression to these people.
>
> Please let's not throw everything into the same pot. The reported
> missing 8250 messages are real regressions due to missing flushes. These
> must be fixed.
>
> The netconsole issue is separate. Unlike 8250, the netconsole does not
> provide a safe variant. This is also a regression, but for different
> reasons.
Just to explain. I reacted on the sentence:
"My only concern is when we add an interface for the unsafe flushing policy,
will we continue to have unsafe flushing be the default for netconsole?"
I wanted to point out that the recent reports about missing messages
from both act 8250 and netconsole were seen as regressions. And
we should try to make it behave as before.
But you are right that the there is a difference. The messages were
missing with:
+ UAW 8250 because of bugs. All nbcon consoles relayed on kthreads
in situations where they did not worked. We are solving this by
explicitly switching to the atomic mode or by an explicit flush.
+ netconsole by design. The netconsole does not have a safe
write_atomic() callback. We should allow unsafe takeover
in some situations.
Now, the question is where to allow the unsafe takeover for
netconsole. I guess that we will need to allow it in similar
situations where people complained about DAR 8250 driver,
or pl011, e.g. even in emergency_restart().
> And maybe users want safe drivers (such as 8250) to enter "hope and pray
> mode" on kernel ending sites, which is something even legacy consoles
> could not always do.
I think that I finally understand your concern. You would like to
add a per-console flag for "debugging" or "safe" mode. But
it might be weird when:
+ netconsole is in the "debugging" mode by default.
+ other serial consoles are in the "safe" mode by default.
Do I get it correctly, please?
> > My take would be to modify the nbcon handling to be more
> > like the legacy one and focus more on debugging. If anyone
> > gets concerned by the reboot reliability then we
> > could add the --panic-focus-on-reboot and make
> > the reboot more safe in this case.
>
> I prefer we do not hard-code policies. It would be trivial to add a
> policy field and flags to the console struct. We could allow drivers to
> declare their own diverging defaults if they want. When we are touching
> all these flush sites, let us add code guided by policy instead of
> hard-coding policy.
>
> And _later_, once we have /sys/class/consoles, it becomes trivial to
> expose these policies to userspace for reading/modifying.
I think that we should avoid people reporting regressions so that
we should allow unsafe takeover for the netconsole where reasonable
by default.
I see two solutions:
1. Keep all NBCON consoles consistent and allow unsafe takeover
on more locations, independently whether they have safe
or unsafe write_atomic().
2. Allow the unsafe takeover on more locations only for netconsole.
And later allow to set both per-console policies: "debugging" vs. "safe".
And accept that netconsole has different default policy.
I personally prefer the 2nd solution. Netconsole has always been
a bit special. And maybe someone would implement the safe write_atomic
in the future which will make it more normal, ...
Best Regards,
Petr
next prev parent reply other threads:[~2026-11-05 16:50 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 10:01 Ryan Roberts
2026-09-15 10:06 ` Ryan Roberts
2026-09-15 18:49 ` Bradley Morgan
2026-09-16 7:44 ` Ryan Roberts
2026-09-16 14:58 ` Bradley Morgan
2026-09-16 13:08 ` Petr Mladek
2026-10-22 20:35 ` Gustavo Luiz Duarte
2026-10-23 7:57 ` John Ogness
2026-10-23 10:36 ` Petr Mladek
2026-10-27 16:12 ` Breno Leitao
2026-10-27 17:43 ` Breno Leitao
2026-10-27 18:01 ` John Ogness
2026-10-28 11:24 ` Breno Leitao
2026-10-28 10:52 ` Breno Leitao
2026-10-28 14:37 ` John Ogness
2026-10-28 21:15 ` Breno Leitao
2026-10-29 9:20 ` John Ogness
2026-10-29 10:58 ` Breno Leitao
2026-10-29 13:53 ` John Ogness
2026-10-29 14:37 ` Petr Mladek
2026-10-30 17:56 ` Breno Leitao
2026-11-02 10:28 ` Petr Mladek
2026-11-02 13:27 ` Breno Leitao
2026-11-02 22:22 ` John Ogness
2026-11-03 13:31 ` Petr Mladek
2026-11-04 11:18 ` John Ogness
2026-11-05 16:50 ` Petr Mladek [this message]
2026-11-05 19:01 ` John Ogness
2026-11-02 22:14 ` John Ogness
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=auyz7JPCK7K9QFT_@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=akpm@linux-foundation.org \
--cc=john.ogness@linutronix.de \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rioo.tsukatsukii@gmail.com \
--cc=rostedt@goodmis.org \
--cc=ryan.roberts@arm.com \
--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®