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,
Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
Shrikanth Hegde <sshegde@linux.ibm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jason Wessel <jason.wessel@windriver.com>,
Daniel Thompson <danielt@kernel.org>,
Douglas Anderson <dianders@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>,
Feng Tang <feng.tang@linux.alibaba.com>,
Rio <rioo.tsukatsukii@gmail.com>,
Bradley Morgan <brads@mainlining.org>,
Pnina Feder <pnina.feder@mobileye.com>,
Gal Pressman <gal@nvidia.com>, Petr Pavlu <petr.pavlu@suse.com>,
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>,
Oleg Nesterov <oleg@redhat.com>,
"Cen Zhang (Microsoft)" <blbllhy@gmail.com>,
loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org,
kgdb-bugreport@lists.sourceforge.net
Subject: Re: [PATCH printk v2 1/6] printk: Introduce and specify flush reasons
Date: Mon, 16 Nov 2026 18:26:21 +0106 [thread overview]
Message-ID: <87cxs4y9pm.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <avcnSjj2P9UfsBn7@pathway.suse.cz>
On 2026-11-13, Petr Mladek <pmladek@suse.com> wrote:
> This entire patchset adds a lot of complexity just to enable all
> 4 new policy flags for netconsole in the last patch.
>
> There already have few dimensions which affect console flushing:
>
> + console_loglevel
> + nbcon_prio
"Dimensions" is the correct word. These are orthogonal:
+ console_loglevel: which messages to print
+ nbcon_prio: which context is allowed access to hardware
+ pr_flush_reason: reason for atomic flushing
+ unsafe_flush_flags: policy when unsafe flushing is acceptable
I do not see a single property above where a value in one implies a
value in another.
> This patchset adds 8 new terms in pr_flush_reason and
> nbcon_unsafe_flush_flags just to explicitly set all
> flush_flags in netconsole.
>
> Let's start with pr_flush_reason. I am not sure if it is worth it:
>
> + PR_FLUSH_RUNTIME is the default
>
> + PR_FLUSH_RESTART can be detected by system_state > SYSTEM_RUNNING
This does not cover the panic-restart case.
> + PR_FLUSH_HANG has only one caller currently distinguished by
> the global panic_nbcon_allow_unsafe_takeover
In my series there is another user:
arch/loongarch/kernel/reset.c:machine_halt()
> + PR_FLUSH_KDB can be detected by kdb_trap_printk and
> kdb_printf_cpu, see vprintk() implementation.
Ack. PR_FLUSH_RUNTIME could cover this case.
> IMHO, it makes things worse because nbcon_atomic_flush_pending() has
> to use PR_FLUSH_RUNTIME in vprintk_emit(). But I think that we
> would like to flush it the same way as an explicit flush called
> in the given context.
You write it backwards. vprintk_emit() uses
nbcon_atomic_flush_pending(). Calling printk() (a single record) is
quite different than calling printk_trigger_flush() (flushing a
backlog).
Let us discuss this after I respond to your comments on patch 2/6. There
you include many details and suggestions that require closer inspection.
John
next prev parent reply other threads:[~2026-11-16 17:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 18:19 [PATCH printk v2 0/6] Introduce policies for unsafe flushing John Ogness
2026-11-11 18:19 ` [PATCH printk v2 1/6] printk: Introduce and specify flush reasons John Ogness
2026-11-13 15:05 ` Petr Mladek
2026-11-16 17:20 ` John Ogness [this message]
2026-11-11 18:19 ` [PATCH printk v2 2/6] console: Introduce unsafe flush policy flags John Ogness
2026-11-13 16:17 ` Petr Mladek
2026-11-11 18:19 ` [PATCH printk v2 3/6] printk: Evaluate flush policy in nbcon_allow_unsafe_takeover() John Ogness
2026-11-11 18:19 ` [PATCH printk v2 4/6] printk: Remove nbcon_atomic_flush_unsafe() John Ogness
2026-11-11 18:19 ` [PATCH printk v2 5/6] printk: Add panic+kexec flush point John Ogness
2026-11-11 18:19 ` [PATCH printk v2 6/6] netconsole: Always perform unsafe flushing on panic/kdb/restart 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=87cxs4y9pm.fsf@jogness.linutronix.de \
--to=john.ogness@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=blbllhy@gmail.com \
--cc=brads@mainlining.org \
--cc=chenhuacai@kernel.org \
--cc=chleroy@kernel.org \
--cc=danielt@kernel.org \
--cc=dianders@chromium.org \
--cc=feng.tang@linux.alibaba.com \
--cc=gal@nvidia.com \
--cc=gregkh@linuxfoundation.org \
--cc=jason.wessel@windriver.com \
--cc=kernel@xen0n.name \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=loongarch@lists.linux.dev \
--cc=maddy@linux.ibm.com \
--cc=mchauras@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=oleg@redhat.com \
--cc=petr.pavlu@suse.com \
--cc=pmladek@suse.com \
--cc=pnina.feder@mobileye.com \
--cc=printk@lists.linux.dev \
--cc=ptikhomirov@virtuozzo.com \
--cc=rioo.tsukatsukii@gmail.com \
--cc=ritesh.list@gmail.com \
--cc=rostedt@goodmis.org \
--cc=ryan.roberts@arm.com \
--cc=senozhatsky@chromium.org \
--cc=sshegde@linux.ibm.com \
/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®