Re: [PATCH] printk/tracing: Do not trace printk_nmi_enter()

From: Peter Zijlstra
Date: Fri Sep 07 2018 - 10:02:52 EST


On Fri, Sep 07, 2018 at 09:55:33AM -0400, Steven Rostedt wrote:
> On Fri, 7 Sep 2018 15:45:32 +0200
> Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> > Yes really, we should not muck with the IRQ state from NMI context.
>
> Right, and we didn't. Your patch didn't change anything, but allow for

It does, it kills lockdep before we get to mucking with the IRQ state.

> printk_nmi_enter/exit() to be traced by ftrace, but that's wrong to
> begin with because it ftrace_nmi_enter() hasn't been called yet.

That's a second bug :-) A better solution might be to inline that
function as well. A direct OR instruction is still way faster than a
CALL+RET.