public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Maninder Singh <maninder1.s@samsung.com>
Subject: Re: [PATCH 4.19 regression fix] printk: For early boot messages check loglevel when flushing the buffer
Date: Tue, 11 Sep 2018 11:30:39 +0900	[thread overview]
Message-ID: <20180911023039.GA4065@jagdpanzerIV> (raw)
In-Reply-To: <20180910145747.emvfzv4mzlk5dfqk@pathway.suse.cz>

On (09/10/18 16:57), Petr Mladek wrote:
> 
> Good catch.
> 
> > ---
> > 
> > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> > index c036f128cdc3..ede29a7ba6db 100644
> > --- a/kernel/printk/printk.c
> > +++ b/kernel/printk/printk.c
> > @@ -2545,6 +2545,7 @@ void console_flush_on_panic(void)
> >  	 * ensure may_schedule is cleared.
> >  	 */
> >  	console_trylock();
> > +	exclusive_console = NULL;
> 
> This is not be enough. It would cause replying old messages
> on all consoles.

Oh, that was intentional. I consider repeated messages to be less
problematic than the missing ones.

> Most problems should probably be solved when we store console_seq
> before setting exclusive_console. Then we could clear
> exclusive_console when reaching the stored sequence number.
> 
> Can this be that simple? ;-)

This can work, yes.

I also thought about doing it the way Linus, Jan Kara and Hannes
Reinecke proposed:

- store the console_seq nr of the first oops_in_progress message
  (oops_console_seq) and flush only messages that are in
  [oops_console_seq - 200, log_next_seq] range, as opposed to complete
  logbuf flush.

Hannes asked for this several times. And it was in Jan's printk patches
long time ago (if I'm not mistaken - sorry if I am -- Jan said that Linus
wanted that "just N messages prior to oops" thing).

Jan's patch:
 https://lore.kernel.org/lkml/1457964820-4642-3-git-send-email-sergey.senozhatsky@gmail.com/T/#u


> This reverts commit 375899cddcbb26881b03cb3fbdcfd600e4e67f4a.
> 
> Reported-by: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Petr Mladek <pmladek@suse.com>

Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

	-ss

  parent reply	other threads:[~2018-09-11  2:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 18:01 [PATCH 4.19 regression fix] printk: For early boot messages check loglevel when flushing the buffer Hans de Goede
2018-09-05  2:35 ` Sergey Senozhatsky
2018-09-05  4:53   ` Hans de Goede
2018-09-05  5:36     ` Sergey Senozhatsky
2018-09-05  5:51       ` Sergey Senozhatsky
2018-09-05  8:33       ` Sergey Senozhatsky
2018-09-05 11:02         ` Petr Mladek
2018-09-05 15:20           ` Hans de Goede
2018-09-06 14:31             ` Petr Mladek
2018-09-06  7:29           ` Sergey Senozhatsky
2018-09-06 14:28             ` Petr Mladek
2018-09-07  4:21               ` Sergey Senozhatsky
2018-09-10 14:57                 ` Petr Mladek
2018-09-10 15:02                   ` Hans de Goede
2018-09-11  2:30                   ` Sergey Senozhatsky [this message]
2018-09-11  8:47                     ` Petr Mladek
2018-09-12  7:49                       ` Sergey Senozhatsky
2018-09-12 13:33                         ` Petr Mladek
2018-09-13  2:25                           ` Sergey Senozhatsky
2018-09-06 14:34 ` kbuild test robot

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=20180911023039.GA4065@jagdpanzerIV \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=mingo@redhat.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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