From: John Ogness <john.ogness@linutronix.de>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
Ryan Roberts <ryan.roberts@arm.com>,
Breno Leitao <leitao@debian.org>,
printk@lists.linux.dev, linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH printk v4 6/8] console: Support unsafe flushing for panic/emergency restarts
Date: Thu, 26 Nov 2026 11:51:27 +0106 [thread overview]
Message-ID: <87bj7b7tx4.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <awbqiycLbPPFU2N3@pathway.suse.cz>
On 2026-11-25, Petr Mladek <pmladek@suse.com> wrote:
> Many different flags are mixed in this function:
>
> 1. CON_NBCON_ATOMIC_UNSAFE from enum cons_flags
> 2. NBCON_PRIO_* from enum nbcon_prio
> 3. PR_FLUSH_* from enum pr_flush_reason
> 4. NBCON_*_FLUSH from enum nbcon_unsafe_flush_flags (flush policy)
>
> It is easy to get lost. I wonder if we could do better. ;-)
>
> Ad 1st: CON_NBCON_ATOMIC_UNSAFE is not ideal. But it is done. And
> I am not sure how to make it better.
>
> Ad 2nd: NBCON_PRIO matches nbcon_prio. It look good.
>
> Ad 3rd: PR_FLUSH is not that good. It would be better to
> emphasize that it is a "reason".
>
> I would prefer to use the longer PR_FLUSH_REASON_ prefix.
> It will be consistent with "enum pr_flush_reason" type name
> and more clear.
OK.
> Ad 4th: Both NBCON_*_FLUSH and enum nbcon_unsafe_flush_flags are far
> from clear. And they are not consistent. Sigh, it would be
> great to emphasize "unsafe", "flush" and "policy".
>
> I think about:
>
> enum nbcon_unsafe_flush_policy {
> NBCON_UFP_PANIC_RESTART = BIT(0),
> NBCON_UFP_EMERGENCY_RESTART = BIT(1),
> };
>
> or maybe even better
>
> enum nbcon_unsafe_flush_policy {
> NBCON_UF_POLICY_PANIC_RESTART = BIT(0),
> NBCON_UF_POLICY_EMERGENCY_RESTART = BIT(1),
> };
I am fine with the latter.
> plus use:
>
> struct console {
> [...]
> unsigned int unsafe_flush_policy;
OK.
> and finally the local variable "uf_policy".
OK.
John
next prev parent reply other threads:[~2026-11-26 10:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 16:35 [PATCH printk v4 0/8] Introduce policies for unsafe flushing John Ogness
2026-11-21 16:35 ` [PATCH printk v4 1/8] printk: Introduce and specify flush reasons John Ogness
2026-11-21 16:35 ` [PATCH printk v4 2/8] printk: nbcon: Move unsafe takeover check to higher level John Ogness
2026-11-21 16:35 ` [PATCH printk v4 3/8] printk: Move unsafe takeover check out of console_is_usable() John Ogness
2026-11-24 16:13 ` Petr Mladek
2026-11-26 9:51 ` John Ogness
2026-11-21 16:35 ` [PATCH printk v4 4/8] printk: nbcon: Use @reason instead of global variable to check flush policy John Ogness
2026-11-24 16:27 ` Petr Mladek
2026-11-26 9:53 ` John Ogness
2026-11-21 16:35 ` [PATCH printk v4 5/8] printk: nbcon: Expand unsafe takeover check for general unsafe John Ogness
2026-11-25 10:22 ` Petr Mladek
2026-11-25 13:06 ` Petr Mladek
2026-11-25 14:08 ` Petr Mladek
2026-11-26 10:36 ` John Ogness
2026-11-21 16:35 ` [PATCH printk v4 6/8] console: Support unsafe flushing for panic/emergency restarts John Ogness
2026-11-25 14:02 ` Petr Mladek
2026-11-26 10:45 ` John Ogness [this message]
2026-11-21 16:35 ` [PATCH printk v4 7/8] printk: Add unsafe flush points for panic+kexec and emergency_restart John Ogness
2026-11-21 16:35 ` [PATCH printk v4 8/8] netconsole: Perform unsafe flushing on panic and emergency restart John Ogness
2026-11-23 22:15 ` [PATCH printk v4 0/8] Introduce policies for unsafe flushing Gustavo Luiz Duarte
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=87bj7b7tx4.fsf@jogness.linutronix.de \
--to=john.ogness@linutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=printk@lists.linux.dev \
--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