Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1465764 > unrolled thread
| Started by | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> |
|---|---|
| First post | 2016-08-19 03:20 +0200 |
| Last post | 2016-08-19 03:30 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 00/11] Support Intel® Turbo Boost Max Technology 3.0 Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2016-08-19 03:20 +0200
[PATCH 10/11] acpi: bus: Set _OSC for diverse core support Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2016-08-19 03:20 +0200
Re: [PATCH 10/11] acpi: bus: Set _OSC for diverse core support "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-08-20 02:50 +0200
[PATCH 02/11] sched, x86: Add SD_ASYM_PACKING flags to x86 cpu topology for cpus supporting Intel Turbo Boost Max Technology Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2016-08-19 03:30 +0200
[PATCH 08/11] acpi: cppc: Add prefix cppc to cpudata structure name Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2016-08-19 03:30 +0200
| From | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> |
|---|---|
| Date | 2016-08-19 03:20 +0200 |
| Subject | [PATCH 00/11] Support Intel® Turbo Boost Max Technology 3.0 |
| Message-ID | <s7GtS-7go-115@gated-at.bofh.it> |
With Intel® Turbo Boost Max Technology 3.0 (ITMT), single-threaded performance is
optimized by identifying processor's fastest core and running critical workloads
on it.
Refere to:
http://www.intel.com/content/www/us/en/architecture-and-technology/turbo-boost/turbo-boost-max-technology.html
This patchset consist of all changes required to support ITMT feature:
- Enhance CPPC ACPI lib to support x86
- Use CPPC information in Intel P-State driver to get performance information
- Scheduler enhancements
By default this feature is OFF, to turn on:
# echo 1 > /proc/sys/kernel/sched_itmt_enabled
Srinivas Pandruvada (7):
acpi: cppc: Allow build with ACPI_CPU_FREQ_PSS config
acpi: cpcc: Add integer read support
acpi: cppc: Add support for function fixed hardware address
acpi: cppc: Add prefix cppc to cpudata structure name
acpi: bus: Enable HWP CPPC objects
acpi: bus: Set _OSC for diverse core support
cpufreq: intel_pstate: Use CPPC to get max performance
Tim Chen (4):
sched, cpuset: Add regenerate_sched_domains function to rebuild all
sched domains
sched, x86: Add SD_ASYM_PACKING flags to x86 cpu topology for cpus
supporting Intel Turbo Boost Max Technology
sched: Extend scheduler's asym packing
sched,x86: Enable Turbo Boost Max Technology
arch/x86/Kconfig | 9 +++
arch/x86/include/asm/topology.h | 26 +++++++
arch/x86/kernel/Makefile | 1 +
arch/x86/kernel/itmt.c | 147 ++++++++++++++++++++++++++++++++++++++++
arch/x86/kernel/smpboot.c | 77 ++++++++++++++++-----
drivers/acpi/Kconfig | 1 -
drivers/acpi/bus.c | 9 +++
drivers/acpi/cppc_acpi.c | 88 ++++++++++++++++++++----
drivers/acpi/processor_driver.c | 5 +-
drivers/cpufreq/Kconfig.x86 | 1 +
drivers/cpufreq/cppc_cpufreq.c | 14 ++--
drivers/cpufreq/intel_pstate.c | 75 +++++++++++++++++++-
include/acpi/cppc_acpi.h | 4 +-
include/linux/acpi.h | 1 +
include/linux/cpuset.h | 2 +
include/linux/sched.h | 3 +
kernel/cpuset.c | 32 +++++++--
kernel/sched/core.c | 46 ++++++++++++-
kernel/sched/fair.c | 25 ++++---
kernel/sched/sched.h | 17 +++++
20 files changed, 517 insertions(+), 66 deletions(-)
create mode 100644 arch/x86/kernel/itmt.c
--
2.7.4
[toc] | [next] | [standalone]
| From | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> |
|---|---|
| Date | 2016-08-19 03:20 +0200 |
| Subject | [PATCH 10/11] acpi: bus: Set _OSC for diverse core support |
| Message-ID | <s7GDw-7k3-57@gated-at.bofh.it> |
| In reply to | #1465764 |
Set the OSC_SB_CPC_DIVERSE_HIGH_SUPPORT (bit 12) to enable diverse core support. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> --- drivers/acpi/bus.c | 4 +++- include/linux/acpi.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 61643a5..fbd3b7c 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -336,7 +336,9 @@ static void acpi_bus_osc_support(void) capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPCV2_SUPPORT; } #endif - +#ifdef CONFIG_SCHED_ITMT + capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_DIVERSE_HIGH_SUPPORT; +#endif if (!ghes_disable) capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_APEI_SUPPORT; if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 4d8452c..17f6e08 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -460,6 +460,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); #define OSC_SB_CPCV2_SUPPORT 0x00000040 #define OSC_SB_PCLPI_SUPPORT 0x00000080 #define OSC_SB_OSLPI_SUPPORT 0x00000100 +#define OSC_SB_CPC_DIVERSE_HIGH_SUPPORT 0x00001000 extern bool osc_sb_apei_support_acked; extern bool osc_pc_lpi_support_confirmed; -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2016-08-20 02:50 +0200 |
| Subject | Re: [PATCH 10/11] acpi: bus: Set _OSC for diverse core support |
| Message-ID | <s82E1-4lh-15@gated-at.bofh.it> |
| In reply to | #1465767 |
On Thursday, August 18, 2016 03:36:51 PM Srinivas Pandruvada wrote: > Set the OSC_SB_CPC_DIVERSE_HIGH_SUPPORT (bit 12) to enable diverse > core support. > > Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> > --- > drivers/acpi/bus.c | 4 +++- > include/linux/acpi.h | 1 + > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c > index 61643a5..fbd3b7c 100644 > --- a/drivers/acpi/bus.c > +++ b/drivers/acpi/bus.c > @@ -336,7 +336,9 @@ static void acpi_bus_osc_support(void) > capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPCV2_SUPPORT; > } > #endif > - > +#ifdef CONFIG_SCHED_ITMT > + capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_DIVERSE_HIGH_SUPPORT; > +#endif if (IS_ENABLED(CONFIG_SCHED_ITMT)) capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_CPC_DIVERSE_HIGH_SUPPORT; pretty please. > if (!ghes_disable) > capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_APEI_SUPPORT; > if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > index 4d8452c..17f6e08 100644 > --- a/include/linux/acpi.h > +++ b/include/linux/acpi.h > @@ -460,6 +460,7 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); > #define OSC_SB_CPCV2_SUPPORT 0x00000040 > #define OSC_SB_PCLPI_SUPPORT 0x00000080 > #define OSC_SB_OSLPI_SUPPORT 0x00000100 > +#define OSC_SB_CPC_DIVERSE_HIGH_SUPPORT 0x00001000 > > extern bool osc_sb_apei_support_acked; > extern bool osc_pc_lpi_support_confirmed; > Thanks, Rafael
[toc] | [prev] | [next] | [standalone]
| From | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> |
|---|---|
| Date | 2016-08-19 03:30 +0200 |
| Subject | [PATCH 02/11] sched, x86: Add SD_ASYM_PACKING flags to x86 cpu topology for cpus supporting Intel Turbo Boost Max Technology |
| Message-ID | <s7GNc-7nF-11@gated-at.bofh.it> |
| In reply to | #1465764 |
From: Tim Chen <tim.c.chen@linux.intel.com>
We uses ASYM_PACKING feature in the scheduler to move tasks to more
capable cpus that can be boosted to higher frequency. We mark the sched
domain topology level with SD_ASYM_PACKING flag for such systems.
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 | 77 ++++++++++++++++++++++++++++++++++++-----------
kernel/sched/core.c | 3 ++
2 files changed, 62 insertions(+), 18 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2a6e84a..255f64e 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -464,31 +464,59 @@ static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
return false;
}
-static struct sched_domain_topology_level numa_inside_package_topology[] = {
+#ifdef CONFIG_SCHED_ITMT
+extern unsigned int sysctl_sched_itmt_enabled;
+
+static int x86_core_flags(void)
+{
+ int flags = cpu_core_flags();
+
+ if (sysctl_sched_itmt_enabled)
+ flags |= SD_ASYM_PACKING;
+
+ return flags;
+}
+
+static int x86_smt_flags(void)
+{
+ int flags = cpu_smt_flags();
+
+ if (sysctl_sched_itmt_enabled)
+ flags |= SD_ASYM_PACKING;
+
+ return flags;
+}
+#else
+#define x86_core_flags cpu_core_flags
+#define x86_smt_flags cpu_smt_flags
+#endif
+
+static struct sched_domain_topology_level x86_topology[] = {
+#ifdef CONFIG_SCHED_SMT
+ { cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) },
+#endif
+#ifdef CONFIG_SCHED_MC
+ { cpu_coregroup_mask, x86_core_flags, SD_INIT_NAME(MC) },
+#endif
+ { cpu_cpu_mask, SD_INIT_NAME(DIE) },
+ { NULL, },
+};
+
+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, },
};
+
/*
- * set_sched_topology() sets the topology internal to a CPU. The
- * NUMA topologies are layered on top of it to build the full
- * system topology.
- *
- * If NUMA nodes are observed to occur within a CPU package, this
- * function should be called. It forces the sched domain code to
- * only use the SMT level for the CPU portion of the topology.
- * This essentially falls back to relying on NUMA information
- * from the SRAT table to describe the entire system topology
- * (except for hyperthreads).
+ * Set if a package/die has multiple NUMA nodes inside.
+ * AMD Magny-Cours and Intel Cluster-on-Die have this.
*/
-static void primarily_use_numa_for_topology(void)
-{
- set_sched_topology(numa_inside_package_topology);
-}
+static bool x86_has_numa_in_package = false;
void set_cpu_sibling_map(int cpu)
{
@@ -551,7 +579,7 @@ void set_cpu_sibling_map(int cpu)
c->booted_cores = cpu_data(i).booted_cores;
}
if (match_die(c, o) && !topology_same_node(c, o))
- primarily_use_numa_for_topology();
+ x86_has_numa_in_package = true;
}
threads = cpumask_weight(topology_sibling_cpumask(cpu));
@@ -1297,6 +1325,16 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
zalloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL);
zalloc_cpumask_var(&per_cpu(cpu_llc_shared_map, i), GFP_KERNEL);
}
+
+ /*
+ * Set 'default' x86 topology, this matches default_topology() in that
+ * it has NUMA nodes as a topology level. See also
+ * native_smp_cpus_done().
+ *
+ * Must be done before set_cpus_sibling_map() is ran.
+ */
+ set_sched_topology(x86_topology);
+
set_cpu_sibling_map(0);
switch (smp_sanity_check(max_cpus)) {
@@ -1363,6 +1401,9 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
{
pr_debug("Boot done\n");
+ if (x86_has_numa_in_package)
+ set_sched_topology(x86_numa_in_package_topology);
+
nmi_selftest();
impress_friends();
setup_ioapic_dest();
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ec752da..342eca9 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6487,6 +6487,9 @@ static struct sched_domain_topology_level *sched_domain_topology =
void set_sched_topology(struct sched_domain_topology_level *tl)
{
+ if (WARN_ON_ONCE(sched_smp_initialized))
+ return;
+
sched_domain_topology = tl;
}
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> |
|---|---|
| Date | 2016-08-19 03:30 +0200 |
| Subject | [PATCH 08/11] acpi: cppc: Add prefix cppc to cpudata structure name |
| Message-ID | <s7GNc-7nF-33@gated-at.bofh.it> |
| In reply to | #1465764 |
Since struct cpudata is defined in a header file, add prefix cppc_ to
make it not a generic name. Otherwise it causes compile issue in locally
define structure with the same name.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/acpi/cppc_acpi.c | 4 ++--
drivers/cpufreq/cppc_cpufreq.c | 14 +++++++-------
include/acpi/cppc_acpi.h | 4 ++--
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 939fb5c..5ca517d 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -276,13 +276,13 @@ end:
*
* Return: 0 for success or negative value for err.
*/
-int acpi_get_psd_map(struct cpudata **all_cpu_data)
+int acpi_get_psd_map(struct cppc_cpudata **all_cpu_data)
{
int count_target;
int retval = 0;
unsigned int i, j;
cpumask_var_t covered_cpus;
- struct cpudata *pr, *match_pr;
+ struct cppc_cpudata *pr, *match_pr;
struct acpi_psd_package *pdomain;
struct acpi_psd_package *match_pdomain;
struct cpc_desc *cpc_ptr, *match_cpc_ptr;
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 8882b8e..b1b3549 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -30,13 +30,13 @@
* performance capabilities, desired performance level
* requested etc.
*/
-static struct cpudata **all_cpu_data;
+static struct cppc_cpudata **all_cpu_data;
static int cppc_cpufreq_set_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
- struct cpudata *cpu;
+ struct cppc_cpudata *cpu;
struct cpufreq_freqs freqs;
int ret = 0;
@@ -66,7 +66,7 @@ static int cppc_verify_policy(struct cpufreq_policy *policy)
static void cppc_cpufreq_stop_cpu(struct cpufreq_policy *policy)
{
int cpu_num = policy->cpu;
- struct cpudata *cpu = all_cpu_data[cpu_num];
+ struct cppc_cpudata *cpu = all_cpu_data[cpu_num];
int ret;
cpu->perf_ctrls.desired_perf = cpu->perf_caps.lowest_perf;
@@ -79,7 +79,7 @@ static void cppc_cpufreq_stop_cpu(struct cpufreq_policy *policy)
static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
- struct cpudata *cpu;
+ struct cppc_cpudata *cpu;
unsigned int cpu_num = policy->cpu;
int ret = 0;
@@ -134,7 +134,7 @@ static struct cpufreq_driver cppc_cpufreq_driver = {
static int __init cppc_cpufreq_init(void)
{
int i, ret = 0;
- struct cpudata *cpu;
+ struct cppc_cpudata *cpu;
if (acpi_disabled)
return -ENODEV;
@@ -144,7 +144,7 @@ static int __init cppc_cpufreq_init(void)
return -ENOMEM;
for_each_possible_cpu(i) {
- all_cpu_data[i] = kzalloc(sizeof(struct cpudata), GFP_KERNEL);
+ all_cpu_data[i] = kzalloc(sizeof(struct cppc_cpudata), GFP_KERNEL);
if (!all_cpu_data[i])
goto out;
@@ -175,7 +175,7 @@ out:
static void __exit cppc_cpufreq_exit(void)
{
- struct cpudata *cpu;
+ struct cppc_cpudata *cpu;
int i;
cpufreq_unregister_driver(&cppc_cpufreq_driver);
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
index 284965c..b7816c2 100644
--- a/include/acpi/cppc_acpi.h
+++ b/include/acpi/cppc_acpi.h
@@ -114,7 +114,7 @@ struct cppc_perf_fb_ctrs {
};
/* Per CPU container for runtime CPPC management. */
-struct cpudata {
+struct cppc_cpudata {
int cpu;
struct cppc_perf_caps perf_caps;
struct cppc_perf_ctrls perf_ctrls;
@@ -127,6 +127,6 @@ struct cpudata {
extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs);
extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
-extern int acpi_get_psd_map(struct cpudata **);
+extern int acpi_get_psd_map(struct cppc_cpudata **);
#endif /* _CPPC_ACPI_H*/
--
2.7.4
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web