Re: [PATCH 2/2] perf/x86/intel, watchdog: Switch NMI watchdog to ref cycles on x86

From: Peter Zijlstra
Date: Mon May 22 2017 - 15:25:03 EST


On Mon, May 22, 2017 at 04:58:04PM +0000, Liang, Kan wrote:
>
>
> > On Fri, May 19, 2017 at 10:06:22AM -0700, kan.liang@xxxxxxxxx wrote:
> > > This patch was once merged, but reverted later.
> > > Because ref-cycles can not be used anymore when watchdog is enabled.
> > > The commit is 44530d588e142a96cf0cd345a7cb8911c4f88720
> > >
> > > The patch 1/2 has extended the ref-cycles to GP counter. The concern
> > > should be gone.
> >
> > So its not a problem if every Atom prior to Goldmont, and all Core/Core2
> > products regress?
> >
> > P6 and P4 you've entirely broken, as they don't have REF_CPU_CYCLES at all.
> >
> > So no, I don't think this is right even now.
> >
>
> Right, the patch 1/2 doesn't cover all platforms.
> I will only apply the patch for the platforms,
> which have ref cycles on GP counters.

Right, so if you move the weak function into arch/x86/events/core.c and
simply test for x86_pmu.this_ref_alis_function_thing being !NULL that
should all work.