The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Feng Tang <feng.tang@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	linux-kernel@vger.kernel.org,
	Aaro Koskinen <aaro.koskinen@nokia.com>,
	Kees Cook <keescook@chromium.org>, Borislav Petkov <bp@suse.de>
Subject: Re: [PATCH v4] panic: add an option to replay all the printk message in buffer
Date: Sat, 27 Apr 2019 01:43:02 +0900	[thread overview]
Message-ID: <20190426164302.GA26127@tigerII.localdomain> (raw)
In-Reply-To: <20190426141426.h7hpvhr3rqp7umbk@pathway.suse.cz>

On (04/26/19 16:14), Petr Mladek wrote:
>
> Then I wonder why, for example, native_stop_other_cpus() waits
> 10ms at maximum after sending the NMIs. What is the state
> of the CPUs that miss this deadline?

Well, I saw a case when CPU was forcibly powered off (embedded),
for instance.

> > - But, more importantly, if that CPUB is in atomic context, then panic
> >   CPUA will spin, waiting for that CPUB to handoff printing, before
> >   panic CPU will even try to stop all CPUs.
> > 
> > 	pr_emerg("Kernel panic - not syncing: %s\n", buf)
> > 
> >   is the point of 'synchronization' - panic CPU will wait for
> >   current console owner.
> 
> "Synchronization point" is too strong formulation.

But it is sort of synchronized. That's why console_owner patch
set solved the panic-printk deadlock which Google folks reported
a while ago.

> The console waiter logic is effective but it does not always
> work. The current console owner must be calling the console
> drivers.
>
> >   Hmm, we might have a bit of a problem here, maybe.
>
> Hmm, the printk() might wait forever when NMI stopped
> the current console owner in the console driver code
> or with the logbuf_lock taken.

I guess this is why we re-init logbuf lock from panic,
however, we don't do anything with the console_owner.

> The console waiter logic might get solved by clearing
> the console_owner in console_flush_on_panic(). It can't
> be much worse, we already ignore console_lock() there, ...

Right.

[..]
> Anyway, do we really need to have length discussion about
> whether the locks are needed? They will not break anything.

I'm not objecting v5 nor your request to add that locking there.
I'm talking about different things.

	-ss

  reply	other threads:[~2019-04-26 15:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25 13:32 [PATCH v4] panic: add an option to replay all the printk message in buffer Feng Tang
2019-04-26  7:49 ` Petr Mladek
2019-04-26 13:53   ` Sergey Senozhatsky
2019-04-26 14:14     ` Petr Mladek
2019-04-26 16:43       ` Sergey Senozhatsky [this message]
2019-04-26 17:16         ` Sergey Senozhatsky
2019-04-29 11:44           ` Petr Mladek
2019-04-30  6:27             ` Sergey Senozhatsky

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=20190426164302.GA26127@tigerII.localdomain \
    --to=sergey.senozhatsky@gmail.com \
    --cc=aaro.koskinen@nokia.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=feng.tang@intel.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.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