[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YjhF/jWXY5L3I+DZ@linutronix.de>
Date: Mon, 21 Mar 2022 10:31:42 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Schspa Shi <schspa@...il.com>
Cc: pmladek@...e.com, sergey.senozhatsky@...il.com,
rostedt@...dmis.org, john.ogness@...utronix.de,
linux-rt-users@...r.kernel.org, linux-kernel@...r.kernel.org,
tglx@...utronix.de
Subject: Re: [PATCH 5.10-rt] printk: fix suppressed message print when
reboot/panic
On 2022-03-21 13:38:16 [+0800], Schspa Shi wrote:
> Update printk_seq for suppressed message.
>
> Affects 5.9-rt and 5.10-rt
>
> When message is suppressed, printk_seq should be updated, otherwise
> this message will be printed when reboot. This problem was introduced
> in commit 3edc0c85d154 ("printk: Rebase on top of new ring buffer").
So it is only 5.10 given that 5.9 is not maintained.
That commits points to the printk update in v5.9.1-rt18.
John?
> Signed-off-by: Schspa Shi <schspa@...il.com>
> ---
> kernel/printk/printk.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 0c56873396a9..f68c4ba7eb4d 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -2826,8 +2826,17 @@ static int printk_kthread_func(void *data)
> if (!(con->flags & CON_ENABLED))
> continue;
>
> - if (suppress_message_printing(r.info->level))
> + printk_seq = atomic64_read(&con->printk_seq);
> +
> + if (suppress_message_printing(r.info->level)) {
> + /*
> + * Skip record we have buffered and already printed
> + * directly to the console when we received it, and
> + * record that has level above the console loglevel.
> + */
> + atomic64_cmpxchg_relaxed(&con->printk_seq, printk_seq, seq);
> continue;
> + }
>
> if (con->flags & CON_EXTENDED) {
> len = info_print_ext_header(ext_text,
> @@ -2843,7 +2852,6 @@ static int printk_kthread_func(void *data)
> printk_time);
> }
>
> - printk_seq = atomic64_read(&con->printk_seq);
>
> console_lock();
> console_may_schedule = 0;
> --
> 2.29.0
>
Powered by blists - more mailing lists