Re: [PATCH] lockdep: Avoid triggering hardlockup from debug_show_all_locks()

From: Tejun Heo
Date: Tue Jan 23 2018 - 16:12:04 EST


Hello, Steven.

On Tue, Jan 23, 2018 at 04:00:54PM -0500, Steven Rostedt wrote:
> On Tue, 23 Jan 2018 12:57:06 -0800
> Tejun Heo <tj@xxxxxxxxxx> wrote:
>
> > Yeah, it's ridiculous how often printk ends up escalating otherwise
> > recoverable situations into system crashes. I don't know what the
> > right answer is. For spurious NMI hardlockups, maybe auditing debug
> > paths and adding touch_nmi_watchdog() would be enough but that also is
> > a pretty leaky approach.
>
> What about if every printk were to touch NMI watchdog?
>
> NMI watchdog is really there for when the system locks up. If the
> system is locked up doing printk, at least we see what is happening,
> and not a total freeze.

Yeah, that would definitely be a solution. The downside is that when
the system completely locks up from printk storm while holding
critical locks (say, tasklist_lock), the watchdog won't be able to
reset the system. I guess the judgement would depend on what one
expects of the NMI watchdog, but I personally would be happier with
printk touching NMI automatically.

Thanks.

--
tejun