Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Tim Chen
On 11/19/2018 04:58 AM, Thomas Gleixner wrote: >> +DECLARE_STATIC_KEY_TRUE(cpu_smt_enabled); > > And here it is declared unconditionally which allows code to use it despite > CONFIG_HOTPLUG_SMT=n and subsequently breaks the build. Will put this under #ifdef CONFIG_HOTPLUG_SMT Tim

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Tim Chen
On 11/19/2018 04:58 AM, Thomas Gleixner wrote: >> +DECLARE_STATIC_KEY_TRUE(cpu_smt_enabled); > > And here it is declared unconditionally which allows code to use it despite > CONFIG_HOTPLUG_SMT=n and subsequently breaks the build. Will put this under #ifdef CONFIG_HOTPLUG_SMT Tim

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Tim Chen
Thomas, >> >> +#ifdef CONFIG_SCHED_SMT >> + >> +extern struct static_key_false sched_smt_present; >> + >> +static inline bool cpu_smt_present(void) >> +{ >> +if (static_branch_unlikely(_smt_present)) >> +return true; >> +else >> +return false; > > What's wrong

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Tim Chen
Thomas, >> >> +#ifdef CONFIG_SCHED_SMT >> + >> +extern struct static_key_false sched_smt_present; >> + >> +static inline bool cpu_smt_present(void) >> +{ >> +if (static_branch_unlikely(_smt_present)) >> +return true; >> +else >> +return false; > > What's wrong

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Thomas Gleixner
Tim, On Mon, 19 Nov 2018, Tim Chen wrote: > On 11/19/2018 06:57 AM, Peter Zijlstra wrote: > > In particular, the SMT topology bits are set before we enable > > interrrupts and similarly, are cleared after we disable interrupts for > > the last time and die. > > > Peter & Thomas, > > Any

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Thomas Gleixner
Tim, On Mon, 19 Nov 2018, Tim Chen wrote: > On 11/19/2018 06:57 AM, Peter Zijlstra wrote: > > In particular, the SMT topology bits are set before we enable > > interrrupts and similarly, are cleared after we disable interrupts for > > the last time and die. > > > Peter & Thomas, > > Any

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Tim Chen
On 11/19/2018 06:57 AM, Peter Zijlstra wrote: > On Fri, Nov 16, 2018 at 05:53:51PM -0800, Tim Chen wrote: >> In later code, STIBP will be turned on/off in the context switch code >> path when SMT is enabled. Checks for SMT is best >> avoided on such hot paths. >> >> Create cpu_smt_enabled static

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Tim Chen
On 11/19/2018 06:57 AM, Peter Zijlstra wrote: > On Fri, Nov 16, 2018 at 05:53:51PM -0800, Tim Chen wrote: >> In later code, STIBP will be turned on/off in the context switch code >> path when SMT is enabled. Checks for SMT is best >> avoided on such hot paths. >> >> Create cpu_smt_enabled static

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Peter Zijlstra
On Fri, Nov 16, 2018 at 05:53:51PM -0800, Tim Chen wrote: > In later code, STIBP will be turned on/off in the context switch code > path when SMT is enabled. Checks for SMT is best > avoided on such hot paths. > > Create cpu_smt_enabled static key to turn on such SMT specific code > statically.

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Peter Zijlstra
On Fri, Nov 16, 2018 at 05:53:51PM -0800, Tim Chen wrote: > In later code, STIBP will be turned on/off in the context switch code > path when SMT is enabled. Checks for SMT is best > avoided on such hot paths. > > Create cpu_smt_enabled static key to turn on such SMT specific code > statically.

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Thomas Gleixner
On Fri, 16 Nov 2018, Tim Chen wrote: > In later code, STIBP will be turned on/off in the context switch code > path when SMT is enabled. Checks for SMT is best > avoided on such hot paths. > > Create cpu_smt_enabled static key to turn on such SMT specific code > statically. > > This key is set

Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-19 Thread Thomas Gleixner
On Fri, 16 Nov 2018, Tim Chen wrote: > In later code, STIBP will be turned on/off in the context switch code > path when SMT is enabled. Checks for SMT is best > avoided on such hot paths. > > Create cpu_smt_enabled static key to turn on such SMT specific code > statically. > > This key is set

[Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-16 Thread Tim Chen
In later code, STIBP will be turned on/off in the context switch code path when SMT is enabled. Checks for SMT is best avoided on such hot paths. Create cpu_smt_enabled static key to turn on such SMT specific code statically. This key is set in code under hot plug, so it is limited in scope to

[Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code

2018-11-16 Thread Tim Chen
In later code, STIBP will be turned on/off in the context switch code path when SMT is enabled. Checks for SMT is best avoided on such hot paths. Create cpu_smt_enabled static key to turn on such SMT specific code statically. This key is set in code under hot plug, so it is limited in scope to