[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YK+I8YEEnhWjuVAd@hirez.programming.kicks-ass.net>
Date: Thu, 27 May 2021 13:56:33 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Len Brown <lenb@...nel.org>
Cc: Dave Hansen <dave.hansen@...el.com>,
Andy Lutomirski <luto@...nel.org>,
"Chang S. Bae" <chang.seok.bae@...el.com>,
Borislav Petkov <bp@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, X86 ML <x86@...nel.org>,
"Brown, Len" <len.brown@...el.com>,
"Liu, Jing2" <jing2.liu@...el.com>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"Chen, Tim C" <tim.c.chen@...el.com>
Subject: Re: [PATCH v5 28/28] x86/fpu/amx: Clear the AMX state when
appropriate
On Mon, May 24, 2021 at 02:24:54PM -0400, Len Brown wrote:
> On Mon, May 24, 2021 at 1:39 PM Dave Hansen <dave.hansen@...el.com> wrote:
>
> > >> might be considered nasty.
>
> > > I'm not excited about burdening the generic idle path with a CPU
> > > feature specific check that would need to be checked on every idle
> > > entry.
> >
> > Me neither.
> >
> > But, the check itself should be cheap. A cpu_feature_enabled(AMX) check
> > will eliminate even the cost of a branch on systems without AMX. You
> > could probably even get fancy and also use a static branch that doesn't
> > get enabled until the first AMX user shows up.
>
> It isn't just the hardware run-time cost.
> It is the source code complexity.
> That code is 100% generic.
Why can't this live in intel_idle.c ? We had to pull out
CPUIDLE_FLAG_TLB_FLUSH because leave_mm() requires RCU, but afaict both
TILERELEASE and XRESTOR do not and could be added to intel_idle_tile(),
which can be used in XXX_cstates[] for the relevant chips instead of
intel_idle() for C6 and up.
intel_idle_tile(args)
{
bool has_tile = // something XINUSE
if (has_tile)
TILERELEASE
intel_idle(args...);
if (has_tile)
// something XRESTOR
}
Hmm?
Powered by blists - more mailing lists