linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Daniel Wang <wonderfly@google.com>,
	stable@vger.kernel.org, Alexander.Levin@microsoft.com,
	akpm@linux-foundation.org, byungchul.park@lge.com,
	dave.hansen@intel.com, hannes@cmpxchg.org, jack@suse.cz,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Mel Gorman <mgorman@suse.de>,
	mhocko@kernel.org, pavel@ucw.cz,
	penguin-kernel@i-love.sakura.ne.jp, peterz@infradead.org,
	tj@kernel.org, torvalds@linux-foundation.org, vbabka@suse.cz,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Peter Feiner <pfeiner@google.com>
Subject: Re: 4.14 backport request for dbdda842fe96f: "printk: Add console owner and waiter logic to load balance console writes"
Date: Wed, 3 Oct 2018 11:14:00 +0200	[thread overview]
Message-ID: <20181003091400.rgdjpjeaoinnrysx@pathway.suse.cz> (raw)
In-Reply-To: <20181002212327.7aab0b79@vmware.local.home>

On Tue 2018-10-02 21:23:27, Steven Rostedt wrote:
> On Tue, 2 Oct 2018 17:15:17 -0700
> Daniel Wang <wonderfly@google.com> wrote:
> 
> > On Tue, Oct 2, 2018 at 1:42 AM Petr Mladek <pmladek@suse.com> wrote:
> > >
> > > Well, I still wonder why it helped and why you do not see it with 4.4.
> > > I have a feeling that the console owner switch helped only by chance.
> > > In fact, you might be affected by a race in
> > > printk_safe_flush_on_panic() that was fixed by the commit:
> > >
> > > 554755be08fba31c7 printk: drop in_nmi check from printk_safe_flush_on_panic()
> > >
> > > The above one commit might be enough. Well, there was one more
> > > NMI-related race that was fixed by:
> > >
> > > ba552399954dde1b printk: Split the code for storing a message into the log buffer
> > > a338f84dc196f44b printk: Create helper function to queue deferred console handling
> > > 03fc7f9c99c1e7ae printk/nmi: Prevent deadlock when accessing the main log buffer in NMI  
> > 
> > All of these commits already exist in 4.14 stable, since 4.14.68. The deadlock
> > still exists even when built from 4.14.73 (latest tag) though. And cherrypicking
> > dbdda842fe96 fixes it.
> > 
> 
> I don't see the big deal of backporting this. The biggest complaints
> about backports are from fixes that were added to late -rc releases
> where the fixes didn't get much testing. This commit was added in 4.16,
> and hasn't had any issues due to the design. Although a fix has been
> added:
> 
> c14376de3a1 ("printk: Wake klogd when passing console_lock owner")

As I said, I am fine with backporting the console_lock owner stuff
into the stable release.

I just wonder (like Sergey) what the real problem is. The console_lock
owner handshake is not fully reliable. It is might be good enough
to prevent softlockup. But we should not relay on it to prevent
a deadlock.

My new theory ;-)

printk_safe_flush() is called in nmi_trigger_cpumask_backtrace().
=> watchdog_timer_fn() is blocked until all backtraces are printed.

Now, the original report complained that the system rebooted before
all backtraces were printed. It means that panic() was called
on another CPU. My guess is that it is from the hardlockup detector.
And the panic() was not able to flush the console because it was
not able to take console_lock.

IMHO, there was not a real deadlock. The console_lock owner
handshake jsut helped to get console_lock in panic() and
flush all messages before reboot => it is reasonable
and acceptable fix.

Just to be sure. Daniel, could you please send a log with
the console_lock owner stuff backported? There we would see
who called the panic() and why it rebooted early.

Best Regards,
Petr

  reply	other threads:[~2018-10-03  9:14 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-27 19:46 4.14 backport request for dbdda842fe96f: "printk: Add console owner and waiter logic to load balance console writes" Daniel Wang
2018-10-01 19:23 ` Steven Rostedt
2018-10-01 20:13   ` Pavel Machek
2018-10-01 20:21     ` Vlastimil Babka
2018-10-01 20:38       ` Daniel Wang
2018-10-01 20:29     ` Steven Rostedt
2018-10-01 20:37   ` Daniel Wang
2018-10-01 20:40     ` Sasha Levin
2018-10-02  8:42     ` Petr Mladek
2018-10-02 17:21       ` Daniel Wang
2018-10-03  0:15       ` Daniel Wang
2018-10-03  1:23         ` Steven Rostedt
2018-10-03  9:14           ` Petr Mladek [this message]
2018-10-03 17:16             ` Daniel Wang
2018-10-03 17:37               ` Steven Rostedt
2018-10-03 18:37                 ` Daniel Wang
2018-10-03 23:37                   ` Daniel Wang
2018-10-04  7:44                   ` Sergey Senozhatsky
2018-10-04  8:05                     ` Sergey Senozhatsky
2018-10-04  8:36                     ` Petr Mladek
2018-10-04  8:55                       ` Sergey Senozhatsky
2018-10-21 18:09                         ` Daniel Wang
2018-10-22  9:32                           ` Petr Mladek
2018-10-22 10:09                           ` Sergey Senozhatsky
2018-11-01 16:05                             ` Daniel Wang
2018-11-09  6:47                               ` Sergey Senozhatsky
2018-12-12  1:16                                 ` Daniel Wang
2018-12-12  5:21                                   ` Sergey Senozhatsky
2018-12-12  6:08                                     ` Daniel Wang
2018-12-12  6:28                                       ` Sergey Senozhatsky
2018-12-12  6:48                                         ` Sasha Levin
2018-12-12  8:10                                           ` Sergey Senozhatsky
2018-12-12 13:36                                             ` Petr Mladek
2018-12-12 13:59                                               ` Sergey Senozhatsky
2018-12-12 17:43                                                 ` Sasha Levin
2018-12-12 20:11                                                   ` Daniel Wang
2018-12-12 21:43                                                     ` Sasha Levin
2018-12-12 21:49                                                       ` Daniel Wang
2018-12-12 21:52                                                         ` Sasha Levin
2018-12-12 21:56                                                           ` Daniel Wang
2018-12-13  0:40                                                             ` Daniel Wang
2018-12-13  2:27                                                               ` Sergey Senozhatsky
2018-12-13  2:39                                                                 ` Daniel Wang
2018-12-13  9:59                                                                   ` Petr Mladek
2018-12-13 14:29                                                                     ` Sasha Levin
2018-12-13  2:07                                                           ` Sergey Senozhatsky
2018-12-28  0:16                                             ` Sergey Senozhatsky
2018-12-28  8:27                                               ` Greg KH
2018-12-28 22:03                                                 ` Daniel Wang
2018-12-30  3:03                                                   ` Sergey Senozhatsky
2018-10-04  7:49                 ` Petr Mladek
2018-10-02  8:16 ` 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=20181003091400.rgdjpjeaoinnrysx@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=Alexander.Levin@microsoft.com \
    --cc=akpm@linux-foundation.org \
    --cc=byungchul.park@lge.com \
    --cc=dave.hansen@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=peterz@infradead.org \
    --cc=pfeiner@google.com \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    --cc=wonderfly@google.com \
    --cc=xiyou.wangcong@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;
as well as URLs for NNTP newsgroup(s).