All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Guittot <vincent.guittot@linaro.org>
To: peterz@infradead.org, mingo@kernel.org,
	linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com,
	preeti@linux.vnet.ibm.com, tony.luck@intel.com,
	fenghua.yu@intel.com, schwidefsky@de.ibm.com,
	james.hogan@imgtec.com, cmetcalf@tilera.com,
	benh@kernel.crashing.org, linux@arm.linux.org.uk,
	linux-arm-kernel@lists.infradead.org
Cc: linaro-kernel@lists.linaro.org,
	Vincent Guittot <vincent.guittot@linaro.org>
Subject: [PATCH v2 4/7] sched: powerpc: create a dedicated topology table
Date: Tue, 18 Mar 2014 18:56:46 +0100	[thread overview]
Message-ID: <1395165409-18055-5-git-send-email-vincent.guittot@linaro.org> (raw)
In-Reply-To: <1395165409-18055-1-git-send-email-vincent.guittot@linaro.org>

Create a dedicated topology table for handling asymetric feature of powerpc.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
 arch/powerpc/kernel/smp.c | 31 +++++++++++++++++++++++--------
 include/linux/sched.h     |  2 --
 kernel/sched/core.c       |  6 ------
 3 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index ac2621a..c9cade5 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -755,6 +755,28 @@ int setup_profiling_timer(unsigned int multiplier)
 	return 0;
 }
 
+#ifdef CONFIG_SCHED_SMT
+/* cpumask of CPUs with asymetric SMT dependancy */
+static const int powerpc_smt_flags(void)
+{
+	int flags = SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES;
+
+	if (cpu_has_feature(CPU_FTR_ASYM_SMT)) {
+		printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n");
+		flags |= SD_ASYM_PACKING;
+	}
+	return flags;
+}
+#endif
+
+static struct sched_domain_topology_level powerpc_topology[] = {
+#ifdef CONFIG_SCHED_SMT
+	{ cpu_smt_mask, powerpc_smt_flags, SD_INIT_NAME(SMT) },
+#endif
+	{ cpu_cpu_mask, SD_INIT_NAME(DIE) },
+	{ NULL, },
+};
+
 void __init smp_cpus_done(unsigned int max_cpus)
 {
 	cpumask_var_t old_mask;
@@ -779,15 +801,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
 
 	dump_numa_cpu_topology();
 
-}
+	set_sched_topology(powerpc_topology);
 
-int arch_sd_sibling_asym_packing(void)
-{
-	if (cpu_has_feature(CPU_FTR_ASYM_SMT)) {
-		printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n");
-		return SD_ASYM_PACKING;
-	}
-	return 0;
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4db592a..6479de4 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -868,8 +868,6 @@ enum cpu_idle_type {
 #define SD_OVERLAP		0x2000	/* sched_domains of this level overlap */
 #define SD_NUMA			0x4000	/* cross-node balancing */
 
-extern int __weak arch_sd_sibiling_asym_packing(void);
-
 #ifdef CONFIG_SCHED_SMT
 static inline const int cpu_smt_flags(void)
 {
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f2bfa76..0b51ee3 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5833,11 +5833,6 @@ static void init_sched_groups_power(int cpu, struct sched_domain *sd)
 	atomic_set(&sg->sgp->nr_busy_cpus, sg->group_weight);
 }
 
-int __weak arch_sd_sibling_asym_packing(void)
-{
-       return 0*SD_ASYM_PACKING;
-}
-
 /*
  * Initializers for schedule domains
  * Non-inlined to reduce accumulated stack pressure in build_sched_domains()
@@ -6018,7 +6013,6 @@ sd_init(struct sched_domain_topology_level *tl, int cpu)
 	if (sd->flags & SD_SHARE_CPUPOWER) {
 		sd->imbalance_pct = 110;
 		sd->smt_gain = 1178; /* ~15% */
-		sd->flags |= arch_sd_sibling_asym_packing();
 
 	} else if (sd->flags & SD_SHARE_PKG_RESOURCES) {
 		sd->imbalance_pct = 117;
-- 
1.9.0


WARNING: multiple messages have this Message-ID (diff)
From: vincent.guittot@linaro.org (Vincent Guittot)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/7] sched: powerpc: create a dedicated topology table
Date: Tue, 18 Mar 2014 18:56:46 +0100	[thread overview]
Message-ID: <1395165409-18055-5-git-send-email-vincent.guittot@linaro.org> (raw)
In-Reply-To: <1395165409-18055-1-git-send-email-vincent.guittot@linaro.org>

Create a dedicated topology table for handling asymetric feature of powerpc.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
 arch/powerpc/kernel/smp.c | 31 +++++++++++++++++++++++--------
 include/linux/sched.h     |  2 --
 kernel/sched/core.c       |  6 ------
 3 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index ac2621a..c9cade5 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -755,6 +755,28 @@ int setup_profiling_timer(unsigned int multiplier)
 	return 0;
 }
 
+#ifdef CONFIG_SCHED_SMT
+/* cpumask of CPUs with asymetric SMT dependancy */
+static const int powerpc_smt_flags(void)
+{
+	int flags = SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES;
+
+	if (cpu_has_feature(CPU_FTR_ASYM_SMT)) {
+		printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n");
+		flags |= SD_ASYM_PACKING;
+	}
+	return flags;
+}
+#endif
+
+static struct sched_domain_topology_level powerpc_topology[] = {
+#ifdef CONFIG_SCHED_SMT
+	{ cpu_smt_mask, powerpc_smt_flags, SD_INIT_NAME(SMT) },
+#endif
+	{ cpu_cpu_mask, SD_INIT_NAME(DIE) },
+	{ NULL, },
+};
+
 void __init smp_cpus_done(unsigned int max_cpus)
 {
 	cpumask_var_t old_mask;
@@ -779,15 +801,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
 
 	dump_numa_cpu_topology();
 
-}
+	set_sched_topology(powerpc_topology);
 
-int arch_sd_sibling_asym_packing(void)
-{
-	if (cpu_has_feature(CPU_FTR_ASYM_SMT)) {
-		printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n");
-		return SD_ASYM_PACKING;
-	}
-	return 0;
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4db592a..6479de4 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -868,8 +868,6 @@ enum cpu_idle_type {
 #define SD_OVERLAP		0x2000	/* sched_domains of this level overlap */
 #define SD_NUMA			0x4000	/* cross-node balancing */
 
-extern int __weak arch_sd_sibiling_asym_packing(void);
-
 #ifdef CONFIG_SCHED_SMT
 static inline const int cpu_smt_flags(void)
 {
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f2bfa76..0b51ee3 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5833,11 +5833,6 @@ static void init_sched_groups_power(int cpu, struct sched_domain *sd)
 	atomic_set(&sg->sgp->nr_busy_cpus, sg->group_weight);
 }
 
-int __weak arch_sd_sibling_asym_packing(void)
-{
-       return 0*SD_ASYM_PACKING;
-}
-
 /*
  * Initializers for schedule domains
  * Non-inlined to reduce accumulated stack pressure in build_sched_domains()
@@ -6018,7 +6013,6 @@ sd_init(struct sched_domain_topology_level *tl, int cpu)
 	if (sd->flags & SD_SHARE_CPUPOWER) {
 		sd->imbalance_pct = 110;
 		sd->smt_gain = 1178; /* ~15% */
-		sd->flags |= arch_sd_sibling_asym_packing();
 
 	} else if (sd->flags & SD_SHARE_PKG_RESOURCES) {
 		sd->imbalance_pct = 117;
-- 
1.9.0

  parent reply	other threads:[~2014-03-18 17:59 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18 17:56 [PATCH v2 0/7] rework sched_domain topology description Vincent Guittot
2014-03-18 17:56 ` Vincent Guittot
2014-03-18 17:56 ` [PATCH v2 1/7] sched: remove unused SCHED_INIT_NODE Vincent Guittot
2014-03-18 17:56   ` Vincent Guittot
2014-03-19 11:07   ` James Hogan
2014-03-19 11:07     ` James Hogan
2014-03-19 11:07     ` James Hogan
2014-03-18 17:56 ` [PATCH v2 2/7] sched: rework of sched_domain topology definition Vincent Guittot
2014-03-18 17:56   ` Vincent Guittot
2014-03-19  6:01   ` Preeti U Murthy
2014-03-19  6:01     ` Preeti U Murthy
2014-03-19 11:27   ` Dietmar Eggemann
2014-03-19 11:27     ` Dietmar Eggemann
2014-03-19 12:41     ` Peter Zijlstra
2014-03-19 12:41       ` Peter Zijlstra
2014-03-19 13:33       ` Vincent Guittot
2014-03-19 13:33         ` Vincent Guittot
2014-03-19 15:22         ` Dietmar Eggemann
2014-03-19 15:22           ` Dietmar Eggemann
2014-03-19 16:14           ` Vincent Guittot
2014-03-19 16:14             ` Vincent Guittot
2014-03-19 13:46       ` Dietmar Eggemann
2014-03-19 13:46         ` Dietmar Eggemann
2014-03-18 17:56 ` [PATCH v2 3/7] sched: s390: create a dedicated topology table Vincent Guittot
2014-03-18 17:56   ` Vincent Guittot
2014-03-18 17:56 ` Vincent Guittot [this message]
2014-03-18 17:56   ` [PATCH v2 4/7] sched: powerpc: " Vincent Guittot
2014-03-19  6:04   ` Preeti U Murthy
2014-03-19  6:04     ` Preeti U Murthy
2014-03-18 17:56 ` [PATCH v2 5/7] sched: add a new SD_SHARE_POWERDOMAIN for sched_domain Vincent Guittot
2014-03-18 17:56   ` Vincent Guittot
2014-03-19  6:21   ` Preeti U Murthy
2014-03-19  6:21     ` Preeti U Murthy
2014-03-19  9:52     ` Vincent Guittot
2014-03-19  9:52       ` Vincent Guittot
2014-03-19 11:05       ` Preeti U Murthy
2014-03-19 11:05         ` Preeti U Murthy
2014-03-19 12:26         ` Vincent Guittot
2014-03-19 12:26           ` Vincent Guittot
2014-03-19 11:59   ` Peter Zijlstra
2014-03-19 11:59     ` Peter Zijlstra
2014-03-19 12:28     ` Vincent Guittot
2014-03-19 12:28       ` Vincent Guittot
2014-03-19 12:01   ` Peter Zijlstra
2014-03-19 12:01     ` Peter Zijlstra
2014-03-19 12:29     ` Vincent Guittot
2014-03-19 12:29       ` Vincent Guittot
2014-03-18 17:56 ` [PATCH v2 6/7] sched: ARM: create a dedicated scheduler topology table Vincent Guittot
2014-03-18 17:56   ` Vincent Guittot
2014-03-18 17:56 ` [PATCH v2 7/7] sched: powerpc: Add SD_SHARE_POWERDOMAIN for SMT level Vincent Guittot
2014-03-18 17:56   ` Vincent Guittot
2014-03-19 12:05   ` Peter Zijlstra
2014-03-19 12:05     ` Peter Zijlstra
2014-03-19 12:30     ` Vincent Guittot
2014-03-19 12:30       ` Vincent Guittot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395165409-18055-5-git-send-email-vincent.guittot@linaro.org \
    --to=vincent.guittot@linaro.org \
    --cc=benh@kernel.crashing.org \
    --cc=cmetcalf@tilera.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=fenghua.yu@intel.com \
    --cc=james.hogan@imgtec.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.