Re: [PATCH 1/2] watchdog: Fix output

From: Jiri Kosina
Date: Fri Mar 18 2016 - 20:12:05 EST


On Fri, 18 Mar 2016, Peter Zijlstra wrote:

> > -#define pr_fmt(fmt) "NMI watchdog: " fmt
> > +#define pr_fmt(fmt) "Lockup detector: " fmt
> >
> > #include <linux/mm.h>
> > #include <linux/cpu.h>
> > @@ -350,7 +350,7 @@ static void watchdog_overflow_callback(struct perf_event *event,
> > if (__this_cpu_read(hard_watchdog_warn) == true)
> > return;
> >
> > - pr_emerg("Watchdog detected hard LOCKUP on cpu %d", this_cpu);
> > + pr_emerg("Detected hard LOCKUP on cpu %d", this_cpu);
> > print_modules();
> > print_irqtrace_events(current);
> > if (regs)
>
> It was Jiri who made this mess by replacing WARN(), which has a very
> distinct format, with this custom stuff.

Right, this was in 55537871e ("kernel/watchdog.c: perform all-CPU
backtrace in case of hard lockup").

To be really honest, I don't really have 100% reliable explanation why I
did it this way; I *think* it was because otherwise, in case WARN is
preserved, we'll either

- have different output format for current (warning) CPU and all the
others (trigger_allbutself_cpu_backtrace())

or

- have duplicated backtrace for current CPU, one coming from WARN and one
coming from the all-cpu backtrace

> I think we should go back to the WARN() thing.

I don't really have strong opinion on this, but someone should pick the
poison from the two options above; I tried in the mentioned commit, but
apparently not to general satisfaction :)

Thanks,

--
Jiri Kosina
SUSE Labs