Re: [patch V5 04/38] x86: Make hardware latency tracing explicit

Steven Rostedt
2020-05-15T01:43:54Z

On Tue, 12 May 2020 23:01:03 +0200
Thomas Gleixner <tglx@linutronix.de> wrote:

> --- a/arch/x86/kernel/cpu/mce/core.c
> +++ b/arch/x86/kernel/cpu/mce/core.c
> @@ -1916,7 +1916,7 @@ static __always_inline void exc_machine_
> mce_check_crashing_cpu())
> return;
>
> - nmi_enter();
> + nmi_enter_notrace();

Now a machine check exception could happen and be a cause of latency
(although there may be more issues if it does). The "nmi_enter trace"
version does two things. One is for time measurements (if available),
and the other is just letting the hardware latency know it happen (a
simple increment).

The only thing that is checked is "smp_processor_id()" (I just
remembered it doesn't need per cpu, as it only runs on a single CPU at
a time).

Could the notrace version supply the increment, and leave the
trace_clock() in the trace version?

-- Steve

> /*
> * The call targets are marked noinstr, but objtool can't figure
> * that out because it's an indirect call. Annotate it.
>