[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181129154808.GT2131@hirez.programming.kicks-ass.net>
Date: Thu, 29 Nov 2018 16:48:08 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Andy Lutomirski <luto@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jiri Kosina <jkosina@...e.cz>,
Tom Lendacky <thomas.lendacky@....com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
David Woodhouse <dwmw@...zon.co.uk>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>,
Dave Hansen <dave.hansen@...el.com>,
Casey Schaufler <casey.schaufler@...el.com>,
Asit Mallick <asit.k.mallick@...el.com>,
Arjan van de Ven <arjan@...ux.intel.com>,
Jon Masters <jcm@...hat.com>,
Waiman Long <longman9394@...il.com>,
Greg KH <gregkh@...uxfoundation.org>,
Dave Stewart <david.c.stewart@...el.com>,
Kees Cook <keescook@...omium.org>
Subject: Re: [patch V2 08/28] sched/smt: Make sched_smt_present track topology
On Thu, Nov 29, 2018 at 09:50:13AM -0500, Konrad Rzeszutek Wilk wrote:
> On Thu, Nov 29, 2018 at 09:42:56AM -0500, Konrad Rzeszutek Wilk wrote:
> > On Sun, Nov 25, 2018 at 07:33:36PM +0100, Thomas Gleixner wrote:
> > > Currently the 'sched_smt_present' static key is enabled when at CPU bringup
> > > SMT topology is observed, but it is never disabled. However there is demand
> > > to also disable the key when the topology changes such that there is no SMT
> > > present anymore.
> > >
> > > Implement this by making the key count the number of cores that have SMT
> > > enabled.
> > >
> > > In particular, the SMT topology bits are set before interrrupts are enabled
> > > and similarly, are cleared after interrupts are disabled for the last time
> > > and the CPU dies.
> >
> > I see that the number you used is '2', but I thought that there are some
> > CPUs out there (Knights Landing?) that could have four threads?
This code is generic, Sparc, Power and I think MIPS all have parts with
SMT8.
> > Would it be better to have a generic function that would provide the
> > amount of threads the platform does expose - and use that instead
> > of a constant value?
>
> Nevermind - this would work even with 4 threads as we would hit the
> number '2' before '4' and the key would be turned on/off properly.
Indeed so, 2 is the point where we either have more than 1 sibling, or
will go back to 1.
Powered by blists - more mailing lists