Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1660891 > unrolled thread
| Started by | Dietmar Eggemann <dietmar.eggemann@arm.com> |
|---|---|
| First post | 2017-06-08 10:00 +0200 |
| Last post | 2017-06-12 15:10 +0200 |
| Articles | 8 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 0/6] arm, arm64: frequency- and cpu-invariant accounting support for task scheduler Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-06-08 10:00 +0200
[PATCH 1/6] drivers base/arch_topology: prepare cpufreq policy notifier for frequency-invariant load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-06-08 10:00 +0200
Re: [PATCH 1/6] drivers base/arch_topology: prepare cpufreq policy notifier for frequency-invariant load-tracking support Vincent Guittot <vincent.guittot@linaro.org> - 2017-06-12 16:50 +0200
[PATCH 5/6] arm64: wire frequency-invariant accounting support up to the task scheduler Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-06-08 10:00 +0200
Re: [PATCH 5/6] arm64: wire frequency-invariant accounting support up to the task scheduler Catalin Marinas <catalin.marinas@arm.com> - 2017-06-12 15:10 +0200
Re: [PATCH 5/6] arm64: wire frequency-invariant accounting support up to the task scheduler Vincent Guittot <vincent.guittot@linaro.org> - 2017-06-12 16:40 +0200
Re: [PATCH 0/6] arm, arm64: frequency- and cpu-invariant accounting support for task scheduler Juri Lelli <juri.lelli@arm.com> - 2017-06-12 15:10 +0200
Re: [PATCH 0/6] arm, arm64: frequency- and cpu-invariant accounting support for task scheduler Juri Lelli <juri.lelli@arm.com> - 2017-06-12 15:10 +0200
| From | Dietmar Eggemann <dietmar.eggemann@arm.com> |
|---|---|
| Date | 2017-06-08 10:00 +0200 |
| Subject | [PATCH 0/6] arm, arm64: frequency- and cpu-invariant accounting support for task scheduler |
| Message-ID | <tQ0wh-1oo-5@gated-at.bofh.it> |
For a more accurate (i.e. frequency- and cpu-invariant) load-tracking
the task scheduler needs a frequency-scaling and on a heterogeneous
system a cpu-scaling correction factor.
This patch-set implements a Frequency Invariance Engine (FIE)
(topology_get_freq_scale()) in drivers/base/arch_topology.c to provide
a frequency-scaling correction factor.
The Cpu Invariance Engine (CIE) (topology_get_cpu_scale()) providing a
cpu-scaling correction factor was already introduced by the "Fix issues
and factorize arm/arm64 capacity information code" patch-set [1].
This patch-set also enables the frequency- and cpu-invariant accounting
support. Enabling here means to associate (wire) the task scheduler
cname arch_scale_freq_capacity and arch_scale_cpu_capacity with the FIE
and CIE function names from drivers/base/arch_topology.c. This replaces
the task scheduler's default FIE and CIE in kernel/sched/sched.h.
Patch high level description:
[ 01/06] Rework cpufreq policy notifier for frequency-invariant
accounting support
[ 02/06] Frequency Invariance Engine (FIE)
[03,04/06] Enable frequency- and cpu-invariant accounting support on
arm
[05,06/06] Enable frequency- and cpu-invariant accounting support on
arm64
The patch-set is based on top of linux-next/master (tag: next-20170607)
and it is also available from:
git://linux-arm.org/linux-de.git upstream/freq_and_cpu_inv
It has been tested on TC2 (arm) and JUNO (arm64) by running a ramp-up
rt-app task pinned to a cpu with the ondemand cpufreq governor and
checking the load-tracking signals of this task.
[1] https://marc.info/?l=linux-kernel&m=149625018223002&w=2
Dietmar Eggemann (6):
drivers base/arch_topology: prepare cpufreq policy notifier for
frequency-invariant load-tracking support
drivers base/arch_topology: frequency-invariant load-tracking support
arm: wire frequency-invariant accounting support up to the task
scheduler
arm: wire cpu-invariant accounting support up to the task scheduler
arm64: wire frequency-invariant accounting support up to the task
scheduler
arm64: wire cpu-invariant accounting support up to the task scheduler
arch/arm/include/asm/topology.h | 8 +++++
arch/arm/kernel/topology.c | 1 -
arch/arm64/include/asm/topology.h | 8 +++++
arch/arm64/kernel/topology.c | 1 -
drivers/base/arch_topology.c | 64 ++++++++++++++++++++++++++++++++++-----
include/linux/arch_topology.h | 2 ++
6 files changed, 75 insertions(+), 9 deletions(-)
--
2.11.0
[toc] | [next] | [standalone]
| From | Dietmar Eggemann <dietmar.eggemann@arm.com> |
|---|---|
| Date | 2017-06-08 10:00 +0200 |
| Subject | [PATCH 1/6] drivers base/arch_topology: prepare cpufreq policy notifier for frequency-invariant load-tracking support |
| Message-ID | <tQ0wi-1oo-29@gated-at.bofh.it> |
| In reply to | #1660891 |
This patch prepares the actual implementation of the frequency-invariant
load-tracking support provided in the next patch ("drivers
base/arch_topology: frequency-invariant load-tracking support").
The maximum supported frequency of a cpu (policy->cpuinfo.max_freq) has
to be retrieved for frequency-invariant load-tracking.
This can be achieved by coding this functionality into the existing
cpufreq policy notifier (init_cpu_capacity_notifier) which is currently
only used for setting up dt-based cpu capacities (cpu node property
capacity-dmips-mhz).
But frequency-invariant load-tracking has to work whether cpu capacity
dt-parsing succeeded or not.
Change init_cpu_capacity_notifier in such a way that even if the parsing
of the cpu capacity information failed the notifier is called for each
cpufreq policy to be able to set the maximum supported frequency.
The exit condition in register_cpufreq_notifier() now only tests for
!acpi_disabled because for frequency invariance the cpufreq policy
notifier has to be enabled even if u32 *raw_capacity is NULL which
occurs when there is no capacity-dmips-mhz property in the dt file or
when the allocation for raw_capacity[cpu] has failed.
The continue statement in init_cpu_capacity_callback() makes sure that
we don't go on calculating capacity_scale in case the capacity parsing
failed. It should be a break rather a continue here but the next patch
introduces code to set the per-cpu variable max_freq in this
for_each_cpu loop before the check if cap_parsing_failed so it has to
be a continue.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
---
drivers/base/arch_topology.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index d1c33a85059e..272831c89feb 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -173,7 +173,7 @@ init_cpu_capacity_callback(struct notifier_block *nb,
struct cpufreq_policy *policy = data;
int cpu;
- if (cap_parsing_failed || cap_parsing_done)
+ if (cap_parsing_done)
return 0;
switch (val) {
@@ -185,13 +185,17 @@ init_cpu_capacity_callback(struct notifier_block *nb,
cpus_to_visit,
policy->related_cpus);
for_each_cpu(cpu, policy->related_cpus) {
+ if (cap_parsing_failed)
+ continue;
raw_capacity[cpu] = topology_get_cpu_scale(NULL, cpu) *
policy->cpuinfo.max_freq / 1000UL;
capacity_scale = max(raw_capacity[cpu], capacity_scale);
}
if (cpumask_empty(cpus_to_visit)) {
- topology_normalize_cpu_scale();
- kfree(raw_capacity);
+ if (!cap_parsing_failed) {
+ topology_normalize_cpu_scale();
+ kfree(raw_capacity);
+ }
pr_debug("cpu_capacity: parsing done\n");
cap_parsing_done = true;
schedule_work(&parsing_done_work);
@@ -211,7 +215,7 @@ static int __init register_cpufreq_notifier(void)
* until we have the necessary code to parse the cpu capacity, so
* skip registering cpufreq notifier.
*/
- if (!acpi_disabled || !raw_capacity)
+ if (!acpi_disabled)
return -EINVAL;
if (!alloc_cpumask_var(&cpus_to_visit, GFP_KERNEL)) {
--
2.11.0
[toc] | [prev] | [next] | [standalone]
| From | Vincent Guittot <vincent.guittot@linaro.org> |
|---|---|
| Date | 2017-06-12 16:50 +0200 |
| Subject | Re: [PATCH 1/6] drivers base/arch_topology: prepare cpufreq policy notifier for frequency-invariant load-tracking support |
| Message-ID | <tRyPf-3kj-1@gated-at.bofh.it> |
| In reply to | #1660892 |
On 8 June 2017 at 09:55, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
> This patch prepares the actual implementation of the frequency-invariant
> load-tracking support provided in the next patch ("drivers
> base/arch_topology: frequency-invariant load-tracking support").
>
> The maximum supported frequency of a cpu (policy->cpuinfo.max_freq) has
> to be retrieved for frequency-invariant load-tracking.
>
> This can be achieved by coding this functionality into the existing
> cpufreq policy notifier (init_cpu_capacity_notifier) which is currently
> only used for setting up dt-based cpu capacities (cpu node property
> capacity-dmips-mhz).
>
> But frequency-invariant load-tracking has to work whether cpu capacity
> dt-parsing succeeded or not.
>
> Change init_cpu_capacity_notifier in such a way that even if the parsing
> of the cpu capacity information failed the notifier is called for each
> cpufreq policy to be able to set the maximum supported frequency.
>
> The exit condition in register_cpufreq_notifier() now only tests for
> !acpi_disabled because for frequency invariance the cpufreq policy
> notifier has to be enabled even if u32 *raw_capacity is NULL which
> occurs when there is no capacity-dmips-mhz property in the dt file or
> when the allocation for raw_capacity[cpu] has failed.
>
> The continue statement in init_cpu_capacity_callback() makes sure that
> we don't go on calculating capacity_scale in case the capacity parsing
> failed. It should be a break rather a continue here but the next patch
> introduces code to set the per-cpu variable max_freq in this
> for_each_cpu loop before the check if cap_parsing_failed so it has to
> be a continue.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Juri Lelli <juri.lelli@arm.com>
> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
[toc] | [prev] | [next] | [standalone]
| From | Dietmar Eggemann <dietmar.eggemann@arm.com> |
|---|---|
| Date | 2017-06-08 10:00 +0200 |
| Subject | [PATCH 5/6] arm64: wire frequency-invariant accounting support up to the task scheduler |
| Message-ID | <tQ0wi-1oo-33@gated-at.bofh.it> |
| In reply to | #1660891 |
Commit dfbca41f3479 ("sched: Optimize freq invariant accounting")
changed the wiring which now has to be done by associating
arch_scale_freq_capacity with the actual implementation provided
by the architecture.
Define arch_scale_freq_capacity to use the arch_topology "driver"
function topology_get_freq_scale() for the task scheduler's
frequency-invariant accounting instead of the default
arch_scale_freq_capacity() in kernel/sched/sched.h.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
---
arch/arm64/include/asm/topology.h | 5 +++++
arch/arm64/kernel/topology.c | 1 -
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h
index 8b57339823e9..44598a86ec4a 100644
--- a/arch/arm64/include/asm/topology.h
+++ b/arch/arm64/include/asm/topology.h
@@ -32,6 +32,11 @@ int pcibus_to_node(struct pci_bus *bus);
#endif /* CONFIG_NUMA */
+#include <linux/arch_topology.h>
+
+/* Replace task scheduler's default frequency-invariant accounting */
+#define arch_scale_freq_capacity topology_get_freq_scale
+
#include <asm-generic/topology.h>
#endif /* _ASM_ARM_TOPOLOGY_H */
diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
index 79244c75eaec..6cbb6315e493 100644
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -11,7 +11,6 @@
* for more details.
*/
-#include <linux/arch_topology.h>
#include <linux/cpu.h>
#include <linux/cpumask.h>
#include <linux/init.h>
--
2.11.0
[toc] | [prev] | [next] | [standalone]
| From | Catalin Marinas <catalin.marinas@arm.com> |
|---|---|
| Date | 2017-06-12 15:10 +0200 |
| Subject | Re: [PATCH 5/6] arm64: wire frequency-invariant accounting support up to the task scheduler |
| Message-ID | <tRxgu-2xq-1@gated-at.bofh.it> |
| In reply to | #1660894 |
On Thu, Jun 08, 2017 at 08:55:12AM +0100, Dietmar Eggemann wrote:
> Commit dfbca41f3479 ("sched: Optimize freq invariant accounting")
> changed the wiring which now has to be done by associating
> arch_scale_freq_capacity with the actual implementation provided
> by the architecture.
>
> Define arch_scale_freq_capacity to use the arch_topology "driver"
> function topology_get_freq_scale() for the task scheduler's
> frequency-invariant accounting instead of the default
> arch_scale_freq_capacity() in kernel/sched/sched.h.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Juri Lelli <juri.lelli@arm.com>
> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> ---
> arch/arm64/include/asm/topology.h | 5 +++++
> arch/arm64/kernel/topology.c | 1 -
> 2 files changed, 5 insertions(+), 1 deletion(-)
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
[toc] | [prev] | [next] | [standalone]
| From | Vincent Guittot <vincent.guittot@linaro.org> |
|---|---|
| Date | 2017-06-12 16:40 +0200 |
| Subject | Re: [PATCH 5/6] arm64: wire frequency-invariant accounting support up to the task scheduler |
| Message-ID | <tRyFA-3h6-31@gated-at.bofh.it> |
| In reply to | #1660894 |
On 8 June 2017 at 09:55, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
> Commit dfbca41f3479 ("sched: Optimize freq invariant accounting")
> changed the wiring which now has to be done by associating
> arch_scale_freq_capacity with the actual implementation provided
> by the architecture.
>
> Define arch_scale_freq_capacity to use the arch_topology "driver"
> function topology_get_freq_scale() for the task scheduler's
> frequency-invariant accounting instead of the default
> arch_scale_freq_capacity() in kernel/sched/sched.h.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Juri Lelli <juri.lelli@arm.com>
> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
[toc] | [prev] | [next] | [standalone]
| From | Juri Lelli <juri.lelli@arm.com> |
|---|---|
| Date | 2017-06-12 15:10 +0200 |
| Subject | Re: [PATCH 0/6] arm, arm64: frequency- and cpu-invariant accounting support for task scheduler |
| Message-ID | <tRxgu-2xq-11@gated-at.bofh.it> |
| In reply to | #1660891 |
This time hopefully fixing Vincent's email address.. On 12/06/17 14:00, Juri Lelli wrote: > Hi Dietmar, > > On 08/06/17 08:55, Dietmar Eggemann wrote: > > For a more accurate (i.e. frequency- and cpu-invariant) load-tracking > > the task scheduler needs a frequency-scaling and on a heterogeneous > > system a cpu-scaling correction factor. > > > > This patch-set implements a Frequency Invariance Engine (FIE) > > (topology_get_freq_scale()) in drivers/base/arch_topology.c to provide > > a frequency-scaling correction factor. > > > > The Cpu Invariance Engine (CIE) (topology_get_cpu_scale()) providing a > > cpu-scaling correction factor was already introduced by the "Fix issues > > and factorize arm/arm64 capacity information code" patch-set [1]. > > > > This patch-set also enables the frequency- and cpu-invariant accounting > > support. Enabling here means to associate (wire) the task scheduler > > cname arch_scale_freq_capacity and arch_scale_cpu_capacity with the FIE > > and CIE function names from drivers/base/arch_topology.c. This replaces > > the task scheduler's default FIE and CIE in kernel/sched/sched.h. > > > > Patch high level description: > > > > [ 01/06] Rework cpufreq policy notifier for frequency-invariant > > accounting support > > [ 02/06] Frequency Invariance Engine (FIE) > > [03,04/06] Enable frequency- and cpu-invariant accounting support on > > arm > > [05,06/06] Enable frequency- and cpu-invariant accounting support on > > arm64 > > > > The patch-set is based on top of linux-next/master (tag: next-20170607) > > and it is also available from: > > > > git://linux-arm.org/linux-de.git upstream/freq_and_cpu_inv > > > > It has been tested on TC2 (arm) and JUNO (arm64) by running a ramp-up > > rt-app task pinned to a cpu with the ondemand cpufreq governor and > > checking the load-tracking signals of this task. > > > > The whole set looks OK to me, and I tested it as well. > > Feel free to add my > > Reviewed-and-tested-by: Juri Lelli <juri.lelli@arm.com> > > to it. > > Best, > > - Juri
[toc] | [prev] | [next] | [standalone]
| From | Juri Lelli <juri.lelli@arm.com> |
|---|---|
| Date | 2017-06-12 15:10 +0200 |
| Subject | Re: [PATCH 0/6] arm, arm64: frequency- and cpu-invariant accounting support for task scheduler |
| Message-ID | <tRxgu-2xq-13@gated-at.bofh.it> |
| In reply to | #1660891 |
Hi Dietmar, On 08/06/17 08:55, Dietmar Eggemann wrote: > For a more accurate (i.e. frequency- and cpu-invariant) load-tracking > the task scheduler needs a frequency-scaling and on a heterogeneous > system a cpu-scaling correction factor. > > This patch-set implements a Frequency Invariance Engine (FIE) > (topology_get_freq_scale()) in drivers/base/arch_topology.c to provide > a frequency-scaling correction factor. > > The Cpu Invariance Engine (CIE) (topology_get_cpu_scale()) providing a > cpu-scaling correction factor was already introduced by the "Fix issues > and factorize arm/arm64 capacity information code" patch-set [1]. > > This patch-set also enables the frequency- and cpu-invariant accounting > support. Enabling here means to associate (wire) the task scheduler > cname arch_scale_freq_capacity and arch_scale_cpu_capacity with the FIE > and CIE function names from drivers/base/arch_topology.c. This replaces > the task scheduler's default FIE and CIE in kernel/sched/sched.h. > > Patch high level description: > > [ 01/06] Rework cpufreq policy notifier for frequency-invariant > accounting support > [ 02/06] Frequency Invariance Engine (FIE) > [03,04/06] Enable frequency- and cpu-invariant accounting support on > arm > [05,06/06] Enable frequency- and cpu-invariant accounting support on > arm64 > > The patch-set is based on top of linux-next/master (tag: next-20170607) > and it is also available from: > > git://linux-arm.org/linux-de.git upstream/freq_and_cpu_inv > > It has been tested on TC2 (arm) and JUNO (arm64) by running a ramp-up > rt-app task pinned to a cpu with the ondemand cpufreq governor and > checking the load-tracking signals of this task. > The whole set looks OK to me, and I tested it as well. Feel free to add my Reviewed-and-tested-by: Juri Lelli <juri.lelli@arm.com> to it. Best, - Juri
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web