Re: [PATCH 3/3] x86/mce/therm_throt: allow disabling the thermal vector altogether

From: Srinivas Pandruvada
Date: Tue Apr 14 2020 - 17:45:51 EST


On Tue, 2020-04-14 at 23:40 +0200, Peter Zijlstra wrote:
> On Tue, Apr 07, 2020 at 12:33:45AM -0600, Jason A. Donenfeld wrote:
> > The thermal IRQ handler uses 1.21% CPU on my system when it's hot
> > from
> > compiling things. Indeed looking at /proc/interrupts reveals quite
> > a lot
> > of events coming in. Beyond logging them, the existing drivers on
> > the
> > system don't appear to do very much that I'm interested in. So, add
> > a
> > way to disable this entirely so that I can regain precious CPU
> > cycles.
>
> Why is this MCE code?!? hysterical raisins?
When this code was developed long time ago, it was also doing mce
logging. But it is no longer doing mce logging, but code is still
there.


>
> Anyway, I wonder if this is something we should hook up to
> SCHED_THERMAL_PRESSURE, Rafael?
>
> > diff --git a/arch/x86/kernel/cpu/mce/intel.c
> > b/arch/x86/kernel/cpu/mce/intel.c
> > index f996ffb887bc..d14f1922fb49 100644
> > --- a/arch/x86/kernel/cpu/mce/intel.c
> > +++ b/arch/x86/kernel/cpu/mce/intel.c
> > @@ -511,7 +511,8 @@ static void intel_ppin_init(struct cpuinfo_x86
> > *c)
> >
> > void mce_intel_feature_init(struct cpuinfo_x86 *c)
> > {
> > - intel_init_thermal(c);
> > + if (IS_ENABLED(CONFIG_X86_THERMAL_VECTOR))
> > + intel_init_thermal(c);
> > intel_init_cmci();
> > intel_init_lmce();
> > intel_ppin_init(c);
> > --
> > 2.26.0
> >