[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZyzbO5StIhsLv_EP@pathway.suse.cz>
Date: Thu, 7 Nov 2024 16:22:35 +0100
From: Petr Mladek <pmladek@...e.com>
To: Marcos Paulo de Souza <mpdesouza@...e.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
John Ogness <john.ogness@...utronix.de>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org
Subject: Re: [PATCH v2 1/2] printk: Introduce FORCE_CON flag
On Tue 2024-11-05 16:45:08, Marcos Paulo de Souza wrote:
> Introduce FORCE_CON flag to printk. The new flag will make it possible to
> create a context where printk messages will never be suppressed.
>
> This mechanism will be used in the next patch to create a force_con
> context on sysrq handling, removing an existing workaround on the
> loglevel global variable. The workaround existed to make sure that sysrq
> header messages were sent to all consoles, but this doesn't work with
> deferred messages because the loglevel might be restored to its original
> value before a console flushes the messages.
>
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@...e.com>
Looks good:
Reviewed-by: Petr Mladek <pmladek@...e.com>
Just a nit below.
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -1319,11 +1319,11 @@ static void boot_delay_msec(int level)
> {
> unsigned long long k;
> unsigned long timeout;
> + bool suppress = !is_printk_force_console() &&
> + suppress_message_printing(level);
>
> - if ((boot_delay == 0 || system_state >= SYSTEM_RUNNING)
> - || suppress_message_printing(level)) {
> + if ((boot_delay == 0 || system_state >= SYSTEM_RUNNING) || suppress)
> return;
These spaghetti conditions are hard to follow. I would personally
prefer:
if ((boot_delay == 0)
return;
if (system_state >= SYSTEM_RUNNING)
return;
if (suppress_message_printing(level) && !is_printk_force_console())
return;
But I do not resist on it.
Best Regards,
Petr
Powered by blists - more mailing lists