From: preeti@linux.vnet.ibm.com (Preeti U Murthy)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 4/6] sched: powerpc: create a dedicated topology table
Date: Tue, 11 Mar 2014 15:38:07 +0530 [thread overview]
Message-ID: <531EE087.7050707@linux.vnet.ibm.com> (raw)
In-Reply-To: <1394003906-11630-5-git-send-email-vincent.guittot@linaro.org>
Hi Vincent,
On 03/05/2014 12:48 PM, Vincent Guittot wrote:
> Create a dedicated topology table for handling asymetric feature.
> The current proposal creates a new level which describes which groups of CPUs
> take adavantge of SD_ASYM_PACKING. The useless level will be removed during the
> build of the sched_domain topology.
>
> Another solution would be to set SD_ASYM_PACKING in the sd_flags of SMT level
> during the boot sequence and before the build of the sched_domain topology.
Is the below what you mean as the other solution? If it is so, I would
strongly recommend this approach rather than adding another level to the
topology level to represent the asymmetric behaviour.
+static struct sched_domain_topology_level powerpc_topology[] = {
+#ifdef CONFIG_SCHED_SMT
+ { cpu_smt_mask, SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES,
SD_INIT_NAME(SMT) | arch_sd_sibling_asym_packing() },
+#endif
+ { cpu_cpu_mask, SD_INIT_NAME(DIE) },
+ { NULL, },
+};
Regards
Preeti U Murthy
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> arch/powerpc/kernel/smp.c | 35 +++++++++++++++++++++++++++--------
> kernel/sched/core.c | 6 ------
> 2 files changed, 27 insertions(+), 14 deletions(-)
>
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index ac2621a..75da054 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -755,6 +755,32 @@ int setup_profiling_timer(unsigned int multiplier)
> return 0;
> }
>
> +#ifdef CONFIG_SCHED_SMT
> +/* cpumask of CPUs with asymetric SMT dependancy */
> +static const struct cpumask *cpu_asmt_mask(int cpu)
> +{
> + if (cpu_has_feature(CPU_FTR_ASYM_SMT)) {
> + printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n");
> + return topology_thread_cpumask(cpu);
> + }
> + return cpumask_of(cpu);
> +}
> +#endif
> +
> +static struct sched_domain_topology_level powerpc_topology[] = {
> +#ifdef CONFIG_SCHED_SMT
> + { cpu_asmt_mask, SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES | SD_ASYM_PACKING, SD_INIT_NAME(ASMT) },
> + { cpu_smt_mask, SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES, SD_INIT_NAME(SMT) },
> +#endif
> + { cpu_cpu_mask, SD_INIT_NAME(DIE) },
> + { NULL, },
> +};
> +
> +static void __init set_sched_topology(void)
> +{
> + sched_domain_topology = powerpc_topology;
> +}
> +
> void __init smp_cpus_done(unsigned int max_cpus)
> {
> cpumask_var_t old_mask;
> @@ -779,15 +805,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
>
> dump_numa_cpu_topology();
>
> -}
> + set_sched_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/kernel/sched/core.c b/kernel/sched/core.c
> index 3479467..7606de0 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -5818,11 +5818,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()
> @@ -6000,7 +5995,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;
>
WARNING: multiple messages have this Message-ID (diff)
From: Preeti U Murthy <preeti@linux.vnet.ibm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: peterz@infradead.org, mingo@kernel.org,
linux-kernel@vger.kernel.org, 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, dietmar.eggemann@arm.com,
linaro-kernel@lists.linaro.org
Subject: Re: [RFC 4/6] sched: powerpc: create a dedicated topology table
Date: Tue, 11 Mar 2014 15:38:07 +0530 [thread overview]
Message-ID: <531EE087.7050707@linux.vnet.ibm.com> (raw)
In-Reply-To: <1394003906-11630-5-git-send-email-vincent.guittot@linaro.org>
Hi Vincent,
On 03/05/2014 12:48 PM, Vincent Guittot wrote:
> Create a dedicated topology table for handling asymetric feature.
> The current proposal creates a new level which describes which groups of CPUs
> take adavantge of SD_ASYM_PACKING. The useless level will be removed during the
> build of the sched_domain topology.
>
> Another solution would be to set SD_ASYM_PACKING in the sd_flags of SMT level
> during the boot sequence and before the build of the sched_domain topology.
Is the below what you mean as the other solution? If it is so, I would
strongly recommend this approach rather than adding another level to the
topology level to represent the asymmetric behaviour.
+static struct sched_domain_topology_level powerpc_topology[] = {
+#ifdef CONFIG_SCHED_SMT
+ { cpu_smt_mask, SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES,
SD_INIT_NAME(SMT) | arch_sd_sibling_asym_packing() },
+#endif
+ { cpu_cpu_mask, SD_INIT_NAME(DIE) },
+ { NULL, },
+};
Regards
Preeti U Murthy
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> arch/powerpc/kernel/smp.c | 35 +++++++++++++++++++++++++++--------
> kernel/sched/core.c | 6 ------
> 2 files changed, 27 insertions(+), 14 deletions(-)
>
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index ac2621a..75da054 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -755,6 +755,32 @@ int setup_profiling_timer(unsigned int multiplier)
> return 0;
> }
>
> +#ifdef CONFIG_SCHED_SMT
> +/* cpumask of CPUs with asymetric SMT dependancy */
> +static const struct cpumask *cpu_asmt_mask(int cpu)
> +{
> + if (cpu_has_feature(CPU_FTR_ASYM_SMT)) {
> + printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n");
> + return topology_thread_cpumask(cpu);
> + }
> + return cpumask_of(cpu);
> +}
> +#endif
> +
> +static struct sched_domain_topology_level powerpc_topology[] = {
> +#ifdef CONFIG_SCHED_SMT
> + { cpu_asmt_mask, SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES | SD_ASYM_PACKING, SD_INIT_NAME(ASMT) },
> + { cpu_smt_mask, SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES, SD_INIT_NAME(SMT) },
> +#endif
> + { cpu_cpu_mask, SD_INIT_NAME(DIE) },
> + { NULL, },
> +};
> +
> +static void __init set_sched_topology(void)
> +{
> + sched_domain_topology = powerpc_topology;
> +}
> +
> void __init smp_cpus_done(unsigned int max_cpus)
> {
> cpumask_var_t old_mask;
> @@ -779,15 +805,8 @@ void __init smp_cpus_done(unsigned int max_cpus)
>
> dump_numa_cpu_topology();
>
> -}
> + set_sched_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/kernel/sched/core.c b/kernel/sched/core.c
> index 3479467..7606de0 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -5818,11 +5818,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()
> @@ -6000,7 +5995,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;
>
next prev parent reply other threads:[~2014-03-11 10:08 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-05 7:18 [RFC 0/6] rework sched_domain topology description Vincent Guittot
2014-03-05 7:18 ` Vincent Guittot
2014-03-05 7:18 ` [RFC 1/6] sched: remove unused SCHED_INIT_NODE Vincent Guittot
2014-03-05 7:18 ` [PATCH 2/6] sched: rework of sched_domain topology definition Vincent Guittot
2014-03-05 7:18 ` Vincent Guittot
2014-03-05 17:09 ` Dietmar Eggemann
2014-03-05 17:09 ` Dietmar Eggemann
2014-03-06 8:32 ` Vincent Guittot
2014-03-06 8:32 ` Vincent Guittot
2014-03-11 10:31 ` Peter Zijlstra
2014-03-11 10:31 ` Peter Zijlstra
2014-03-11 13:27 ` Vincent Guittot
2014-03-11 13:27 ` Vincent Guittot
2014-03-11 13:48 ` Dietmar Eggemann
2014-03-11 13:48 ` Dietmar Eggemann
2014-03-05 7:18 ` [RFC 3/6] sched: s390: create a dedicated topology table Vincent Guittot
2014-03-05 7:18 ` [RFC 4/6] sched: powerpc: " Vincent Guittot
2014-03-11 10:08 ` Preeti U Murthy [this message]
2014-03-11 10:08 ` Preeti U Murthy
2014-03-11 13:18 ` Vincent Guittot
2014-03-11 13:18 ` Vincent Guittot
2014-03-12 4:42 ` Preeti U Murthy
2014-03-12 4:42 ` Preeti U Murthy
2014-03-12 7:44 ` Vincent Guittot
2014-03-12 7:44 ` Vincent Guittot
2014-03-12 11:04 ` Dietmar Eggemann
2014-03-12 11:04 ` Dietmar Eggemann
2014-03-14 2:30 ` Preeti U Murthy
2014-03-14 2:30 ` Preeti U Murthy
2014-03-14 2:14 ` Preeti U Murthy
2014-03-14 2:14 ` Preeti U Murthy
2014-03-05 7:18 ` [RFC 5/6] sched: add a new SD_SHARE_POWERDOMAIN for sched_domain Vincent Guittot
2014-03-05 7:18 ` [RFC 6/6] sched: ARM: create a dedicated scheduler topology table Vincent Guittot
2014-03-05 22:38 ` Dietmar Eggemann
2014-03-05 22:38 ` Dietmar Eggemann
2014-03-06 8:42 ` Vincent Guittot
2014-03-06 8:42 ` Vincent Guittot
2014-03-05 23:17 ` [RFC 0/6] rework sched_domain topology description Dietmar Eggemann
2014-03-05 23:17 ` Dietmar Eggemann
2014-03-06 9:04 ` Vincent Guittot
2014-03-06 9:04 ` Vincent Guittot
2014-03-06 12:31 ` Dietmar Eggemann
2014-03-06 12:31 ` Dietmar Eggemann
2014-03-07 2:47 ` Vincent Guittot
2014-03-07 2:47 ` Vincent Guittot
2014-03-08 12:40 ` Dietmar Eggemann
2014-03-08 12:40 ` Dietmar Eggemann
2014-03-10 13:21 ` Vincent Guittot
2014-03-10 13:21 ` Vincent Guittot
2014-03-11 13:17 ` Peter Zijlstra
2014-03-11 13:17 ` Peter Zijlstra
2014-03-12 13:28 ` Dietmar Eggemann
2014-03-12 13:28 ` Dietmar Eggemann
2014-03-12 13:47 ` Vincent Guittot
2014-03-12 13:47 ` Vincent Guittot
2014-03-13 14:07 ` Dietmar Eggemann
2014-03-13 14:07 ` Dietmar Eggemann
2014-03-17 11:52 ` Peter Zijlstra
2014-03-17 11:52 ` Peter Zijlstra
2014-03-19 19:15 ` Dietmar Eggemann
2014-03-19 19:15 ` Dietmar Eggemann
2014-03-20 8:28 ` Vincent Guittot
2014-03-20 8:28 ` Vincent Guittot
2014-03-11 13:08 ` Peter Zijlstra
2014-03-11 13:08 ` Peter Zijlstra
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=531EE087.7050707@linux.vnet.ibm.com \
--to=preeti@linux.vnet.ibm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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.