public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Schspa Shi <schspa@gmail.com>
Cc: pmladek@suse.com, sergey.senozhatsky@gmail.com,
	rostedt@goodmis.org, john.ogness@linutronix.de,
	linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	tglx@linutronix.de
Subject: Re: [PATCH 5.10-rt] printk: fix suppressed message print when reboot/panic
Date: Mon, 21 Mar 2022 10:31:42 +0100	[thread overview]
Message-ID: <YjhF/jWXY5L3I+DZ@linutronix.de> (raw)
In-Reply-To: <20220321053815.71316-1-schspa@gmail.com>

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@gmail.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
> 

  parent reply	other threads:[~2022-03-21  9:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21  5:38 [PATCH 5.10-rt] printk: fix suppressed message print when reboot/panic Schspa Shi
2022-03-21  9:30 ` John Ogness
2022-03-21 11:57   ` Shi Schspa
2022-07-11 16:31   ` Steven Rostedt
2022-07-11 16:37     ` Steven Rostedt
2022-03-21  9:31 ` Sebastian Andrzej Siewior [this message]
2022-07-11 16:05   ` Schspa Shi

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=YjhF/jWXY5L3I+DZ@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=schspa@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    /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