diff mbox

[v4,07/10] x86/sched: Add SD_ASYM_PACKING flags to x86 ITMT CPU

Message ID 1474485552-141429-8-git-send-email-srinivas.pandruvada@linux.intel.com (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Srinivas Pandruvada Sept. 21, 2016, 7:19 p.m. UTC
From: Tim Chen <tim.c.chen@linux.intel.com>

Some Intel cores in a package can be boosted to a higher turbo frequency
with ITMT 3.0 technology. The scheduler can use the asymmetric packing
feature to move tasks to the more capable cores.

If ITMT is enabled, add SD_ASYM_PACKING flag to the thread and core
sched domains to enable asymmetric packing.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 arch/x86/kernel/smpboot.c | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

Comments

kernel test robot Sept. 21, 2016, 7:58 p.m. UTC | #1
Hi Tim,

[auto build test ERROR on pm/linux-next]
[also build test ERROR on v4.8-rc7 next-20160921]
[cannot apply to tip/x86/core tip/sched/core]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Srinivas-Pandruvada/Support-Intel-Turbo-Boost-Max-Technology-3-0/20160922-032652
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-randconfig-x010-201638 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   arch/x86/kernel/smpboot.c: In function 'x86_smt_flags':
>> arch/x86/kernel/smpboot.c:506:9: error: implicit declaration of function 'cpu_smt_flags' [-Werror=implicit-function-declaration]
     return cpu_smt_flags() | x86_sched_itmt_flags();
            ^~~~~~~~~~~~~
   At top level:
   arch/x86/kernel/smpboot.c:504:12: warning: 'x86_smt_flags' defined but not used [-Wunused-function]
    static int x86_smt_flags(void)
               ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/cpu_smt_flags +506 arch/x86/kernel/smpboot.c

   500	{
   501		return cpu_core_flags() | x86_sched_itmt_flags();
   502	}
   503	
   504	static int x86_smt_flags(void)
   505	{
 > 506		return cpu_smt_flags() | x86_sched_itmt_flags();
   507	}
   508	
   509	static struct sched_domain_topology_level x86_numa_in_package_topology[] = {

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot Sept. 21, 2016, 8:27 p.m. UTC | #2
Hi Tim,

[auto build test ERROR on pm/linux-next]
[also build test ERROR on v4.8-rc7 next-20160921]
[cannot apply to tip/x86/core tip/sched/core]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Srinivas-Pandruvada/Support-Intel-Turbo-Boost-Max-Technology-3-0/20160922-032652
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-randconfig-x014-201638 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   arch/x86/kernel/smpboot.c: In function 'x86_core_flags':
>> arch/x86/kernel/smpboot.c:501:9: error: implicit declaration of function 'cpu_core_flags' [-Werror=implicit-function-declaration]
     return cpu_core_flags() | x86_sched_itmt_flags();
            ^~~~~~~~~~~~~~
   arch/x86/kernel/smpboot.c: In function 'x86_smt_flags':
   arch/x86/kernel/smpboot.c:506:9: error: implicit declaration of function 'cpu_smt_flags' [-Werror=implicit-function-declaration]
     return cpu_smt_flags() | x86_sched_itmt_flags();
            ^~~~~~~~~~~~~
   At top level:
   arch/x86/kernel/smpboot.c:504:12: warning: 'x86_smt_flags' defined but not used [-Wunused-function]
    static int x86_smt_flags(void)
               ^~~~~~~~~~~~~
   arch/x86/kernel/smpboot.c:499:12: warning: 'x86_core_flags' defined but not used [-Wunused-function]
    static int x86_core_flags(void)
               ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/cpu_core_flags +501 arch/x86/kernel/smpboot.c

   495	{
   496		return sysctl_sched_itmt_enabled ? SD_ASYM_PACKING : 0;
   497	}
   498	
   499	static int x86_core_flags(void)
   500	{
 > 501		return cpu_core_flags() | x86_sched_itmt_flags();
   502	}
   503	
   504	static int x86_smt_flags(void)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Rafael J. Wysocki Sept. 21, 2016, 8:33 p.m. UTC | #3
On Wed, Sep 21, 2016 at 9:19 PM, Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
> From: Tim Chen <tim.c.chen@linux.intel.com>
>
> Some Intel cores in a package can be boosted to a higher turbo frequency
> with ITMT 3.0 technology. The scheduler can use the asymmetric packing
> feature to move tasks to the more capable cores.
>
> If ITMT is enabled, add SD_ASYM_PACKING flag to the thread and core
> sched domains to enable asymmetric packing.
>
> Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
>  arch/x86/kernel/smpboot.c | 27 +++++++++++++++++++++++----
>  1 file changed, 23 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 38901b3..46815e6 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -487,22 +487,41 @@ static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
>         return false;
>  }
>
> +#ifndef CONFIG_SCHED_ITMT
> +#define sysctl_sched_itmt_enabled      0
> +#endif

I thought that would be done in the header where
sysctl_sched_itmt_enabled is declared (along with defining the stubs
for the sched_set_itmt_* functions).

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tim Chen Sept. 22, 2016, 7:40 p.m. UTC | #4
On Wed, 2016-09-21 at 22:33 +0200, Rafael J. Wysocki wrote:
> On Wed, Sep 21, 2016 at 9:19 PM, Srinivas Pandruvada
> <srinivas.pandruvada@linux.intel.com> wrote:
> > 
> > From: Tim Chen <tim.c.chen@linux.intel.com>
> > 
> > Some Intel cores in a package can be boosted to a higher turbo frequency
> > with ITMT 3.0 technology. The scheduler can use the asymmetric packing
> > feature to move tasks to the more capable cores.
> > 
> > If ITMT is enabled, add SD_ASYM_PACKING flag to the thread and core
> > sched domains to enable asymmetric packing.
> > 
> > Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > ---
> >  arch/x86/kernel/smpboot.c | 27 +++++++++++++++++++++++----
> >  1 file changed, 23 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> > index 38901b3..46815e6 100644
> > --- a/arch/x86/kernel/smpboot.c
> > +++ b/arch/x86/kernel/smpboot.c
> > @@ -487,22 +487,41 @@ static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
> >         return false;
> >  }
> > 
> > +#ifndef CONFIG_SCHED_ITMT
> > +#define sysctl_sched_itmt_enabled      0
> > +#endif
> I thought that would be done in the header where
> sysctl_sched_itmt_enabled is declared (along with defining the stubs
> for the sched_set_itmt_* functions).

Sure. I will move it to arch/x86/include/asm/topology.h.

Tim
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 38901b3..46815e6 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -487,22 +487,41 @@  static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
 	return false;
 }
 
+#ifndef CONFIG_SCHED_ITMT
+#define sysctl_sched_itmt_enabled	0
+#endif
+
+static inline int x86_sched_itmt_flags(void)
+{
+	return sysctl_sched_itmt_enabled ? SD_ASYM_PACKING : 0;
+}
+
+static int x86_core_flags(void)
+{
+	return cpu_core_flags() | x86_sched_itmt_flags();
+}
+
+static int x86_smt_flags(void)
+{
+	return cpu_smt_flags() | x86_sched_itmt_flags();
+}
+
 static struct sched_domain_topology_level x86_numa_in_package_topology[] = {
 #ifdef CONFIG_SCHED_SMT
-	{ cpu_smt_mask, cpu_smt_flags, SD_INIT_NAME(SMT) },
+	{ cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) },
 #endif
 #ifdef CONFIG_SCHED_MC
-	{ cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) },
+	{ cpu_coregroup_mask, x86_core_flags, SD_INIT_NAME(MC) },
 #endif
 	{ NULL, },
 };
 
 static struct sched_domain_topology_level x86_topology[] = {
 #ifdef CONFIG_SCHED_SMT
-	{ cpu_smt_mask, cpu_smt_flags, SD_INIT_NAME(SMT) },
+	{ cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) },
 #endif
 #ifdef CONFIG_SCHED_MC
-	{ cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) },
+	{ cpu_coregroup_mask, x86_core_flags, SD_INIT_NAME(MC) },
 #endif
 	{ cpu_cpu_mask, SD_INIT_NAME(DIE) },
 	{ NULL, },