All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] arm: remove cpu_efficiency
@ 2017-10-12 14:00 ` Dietmar Eggemann
  0 siblings, 0 replies; 10+ messages in thread
From: Dietmar Eggemann @ 2017-10-12 14:00 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: Russell King, Vincent Guittot, Juri Lelli

v1: review results [1]:

Vincent pointed out that there is a superfluous continue statement in
parse_dt_topology(). Got rid of it.
Krzysztof Kozlowski took the exynos and Simon Horman the renesas related
dt bits into their for-next (v4.15) branches.

***

For Cortex-A15/A7 arm big.LITTLE systems there are currently two ways to
set the cpu capacity.

The first one (commit 06073ee26775 "ARM: 8621/3: parse cpu
capacity-dmips-mhz from DT") is based on dt 'cpu capacity-dmips-mhz'
bindings and the appropriate dt parsing code in
drivers/base/arch_topology.c. It further takes differences in maximum
cpu frequency values into consideration, normalizes the maximum cpu
capacity to SCHED_CAPACITY_SCALE (1024) and scales all the cpus
accordingly.

  cpu capacity = (capacity-dmips-mhz * max cpu frequency) / 
                 (max capacity-dmips-mhz * max (max cpu frequency)

This solution is shared between arm and arm64 and works for other
combinations of big and little cpus (besides Cortex-A15/A7) as well.

The second one (commit 339ca09d7ada "ARM: 7463/1: topology: Update
cpu_power according to DT information" is based on the 'struct
cpu_efficiency table_efficiency[]' and the dt parsing code in
arch/arm/kernel/topology.c. It further requires a clock-frequency
property per cpu node, calculates a so called middle frequency for an
average cpu in the system which is as close as possible to
SCHED_CAPACITY_SCALE (1024) and uses this to compute the cpu capacity
values.

  cpu capacity = (cpu efficiency * clock frequency) / middle capacity

This solution only works for Cortex-A15/A7 arm big.LITTLE systems.

The aim of this patch is to have only one solution for all arm and arm64
big.LITTLE platforms.

(1) Therefore, it removes the code for the 'cpu_efficiency/
    clock-frequency dt property' (second) solution.

(2) Moreover, it will also assure that the highest original cpu capacity
    (rq->cpu_capacity_orig) in a non-smt system is SCHED_CAPACITY_SCALE
    (1024).

(3) And finally, another advantage is the dynamic detection of the max
    cpu frequency which comes with the first solution instead of the
    static clock-frequency dt property value.

Currently, the arm dt parsing code in parse_dt_topology() checks if the
dt uses the capacity-dmips-mhz property. If this is the case it uses
the first, otherwise the second solution. This patch removes the code
for the second solution from arch/arm/kernel/topology.c.

With the dt related patches for exynos and renesas now in the
appropriated for-next branches for v4.15 there are no Cortex-A15/A7 arm
big.LITTLE systems left relying on the 'cpu_efficiency/clock-frequency
dt property' based solution anymore.

This patch has been tested on TC2 and Samsung Chromebook 2 13"
(peach-pi, Exynos 5800).

[1] https://marc.info/?l=linux-kernel&m=150410411807050&w=2

Changes v1->v2:

  - Rebase on top of v4.14-rc4
  - Remove superfluous continue statement in parse_dt_topology()
    [01/04]
  - Remove 'cpu capacity scale management' and 'cpu capacity table'
    related comments [01/04]
  - Remove dt related patches [02-04/04]

Dietmar Eggemann (1):
  arm: topology: remove cpu_efficiency

 arch/arm/kernel/topology.c | 132 ++-------------------------------------------
 1 file changed, 4 insertions(+), 128 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 0/1] arm: remove cpu_efficiency
@ 2017-10-12 14:00 ` Dietmar Eggemann
  0 siblings, 0 replies; 10+ messages in thread
From: Dietmar Eggemann @ 2017-10-12 14:00 UTC (permalink / raw)
  To: linux-arm-kernel

v1: review results [1]:

Vincent pointed out that there is a superfluous continue statement in
parse_dt_topology(). Got rid of it.
Krzysztof Kozlowski took the exynos and Simon Horman the renesas related
dt bits into their for-next (v4.15) branches.

***

For Cortex-A15/A7 arm big.LITTLE systems there are currently two ways to
set the cpu capacity.

The first one (commit 06073ee26775 "ARM: 8621/3: parse cpu
capacity-dmips-mhz from DT") is based on dt 'cpu capacity-dmips-mhz'
bindings and the appropriate dt parsing code in
drivers/base/arch_topology.c. It further takes differences in maximum
cpu frequency values into consideration, normalizes the maximum cpu
capacity to SCHED_CAPACITY_SCALE (1024) and scales all the cpus
accordingly.

  cpu capacity = (capacity-dmips-mhz * max cpu frequency) / 
                 (max capacity-dmips-mhz * max (max cpu frequency)

This solution is shared between arm and arm64 and works for other
combinations of big and little cpus (besides Cortex-A15/A7) as well.

The second one (commit 339ca09d7ada "ARM: 7463/1: topology: Update
cpu_power according to DT information" is based on the 'struct
cpu_efficiency table_efficiency[]' and the dt parsing code in
arch/arm/kernel/topology.c. It further requires a clock-frequency
property per cpu node, calculates a so called middle frequency for an
average cpu in the system which is as close as possible to
SCHED_CAPACITY_SCALE (1024) and uses this to compute the cpu capacity
values.

  cpu capacity = (cpu efficiency * clock frequency) / middle capacity

This solution only works for Cortex-A15/A7 arm big.LITTLE systems.

The aim of this patch is to have only one solution for all arm and arm64
big.LITTLE platforms.

(1) Therefore, it removes the code for the 'cpu_efficiency/
    clock-frequency dt property' (second) solution.

(2) Moreover, it will also assure that the highest original cpu capacity
    (rq->cpu_capacity_orig) in a non-smt system is SCHED_CAPACITY_SCALE
    (1024).

(3) And finally, another advantage is the dynamic detection of the max
    cpu frequency which comes with the first solution instead of the
    static clock-frequency dt property value.

Currently, the arm dt parsing code in parse_dt_topology() checks if the
dt uses the capacity-dmips-mhz property. If this is the case it uses
the first, otherwise the second solution. This patch removes the code
for the second solution from arch/arm/kernel/topology.c.

With the dt related patches for exynos and renesas now in the
appropriated for-next branches for v4.15 there are no Cortex-A15/A7 arm
big.LITTLE systems left relying on the 'cpu_efficiency/clock-frequency
dt property' based solution anymore.

This patch has been tested on TC2 and Samsung Chromebook 2 13"
(peach-pi, Exynos 5800).

[1] https://marc.info/?l=linux-kernel&m=150410411807050&w=2

Changes v1->v2:

  - Rebase on top of v4.14-rc4
  - Remove superfluous continue statement in parse_dt_topology()
    [01/04]
  - Remove 'cpu capacity scale management' and 'cpu capacity table'
    related comments [01/04]
  - Remove dt related patches [02-04/04]

Dietmar Eggemann (1):
  arm: topology: remove cpu_efficiency

 arch/arm/kernel/topology.c | 132 ++-------------------------------------------
 1 file changed, 4 insertions(+), 128 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/1] arm: topology: remove cpu_efficiency
  2017-10-12 14:00 ` Dietmar Eggemann
@ 2017-10-12 14:00   ` Dietmar Eggemann
  -1 siblings, 0 replies; 10+ messages in thread
From: Dietmar Eggemann @ 2017-10-12 14:00 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: Russell King, Vincent Guittot, Juri Lelli

Remove the 'cpu_efficiency/clock-frequency dt property' based solution
to set cpu capacity which was only working for Cortex-A15/A7 arm
big.LITTLE systems.

I.e. the 'capacity-dmips-mhz' based solution is now the only one. It is
shared between arm and arm64 and works for every big.LITTLE system no
matter which core types it consists of.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Juri Lelli <juri.lelli@gmail.com>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
---
 arch/arm/kernel/topology.c | 132 ++-------------------------------------------
 1 file changed, 4 insertions(+), 128 deletions(-)

diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 24ac3cab411d..15cc131ae387 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -30,69 +30,11 @@
 #include <asm/cputype.h>
 #include <asm/topology.h>
 
-/*
- * cpu capacity scale management
- */
-
-/*
- * cpu capacity table
- * This per cpu data structure describes the relative capacity of each core.
- * On a heteregenous system, cores don't have the same computation capacity
- * and we reflect that difference in the cpu_capacity field so the scheduler
- * can take this difference into account during load balance. A per cpu
- * structure is preferred because each CPU updates its own cpu_capacity field
- * during the load balance except for idle cores. One idle core is selected
- * to run the rebalance_domains for all idle cores and the cpu_capacity can be
- * updated during this sequence.
- */
-
 #ifdef CONFIG_OF
-struct cpu_efficiency {
-	const char *compatible;
-	unsigned long efficiency;
-};
-
-/*
- * Table of relative efficiency of each processors
- * The efficiency value must fit in 20bit and the final
- * cpu_scale value must be in the range
- *   0 < cpu_scale < 3*SCHED_CAPACITY_SCALE/2
- * in order to return at most 1 when DIV_ROUND_CLOSEST
- * is used to compute the capacity of a CPU.
- * Processors that are not defined in the table,
- * use the default SCHED_CAPACITY_SCALE value for cpu_scale.
- */
-static const struct cpu_efficiency table_efficiency[] = {
-	{"arm,cortex-a15", 3891},
-	{"arm,cortex-a7",  2048},
-	{NULL, },
-};
-
-static unsigned long *__cpu_capacity;
-#define cpu_capacity(cpu)	__cpu_capacity[cpu]
-
-static unsigned long middle_capacity = 1;
-static bool cap_from_dt = true;
-
-/*
- * Iterate all CPUs' descriptor in DT and compute the efficiency
- * (as per table_efficiency). Also calculate a middle efficiency
- * as close as possible to  (max{eff_i} - min{eff_i}) / 2
- * This is later used to scale the cpu_capacity field such that an
- * 'average' CPU is of middle capacity. Also see the comments near
- * table_efficiency[] and update_cpu_capacity().
- */
 static void __init parse_dt_topology(void)
 {
-	const struct cpu_efficiency *cpu_eff;
-	struct device_node *cn = NULL;
-	unsigned long min_capacity = ULONG_MAX;
-	unsigned long max_capacity = 0;
-	unsigned long capacity = 0;
-	int cpu = 0;
-
-	__cpu_capacity = kcalloc(nr_cpu_ids, sizeof(*__cpu_capacity),
-				 GFP_NOWAIT);
+	struct device_node *cn;
+	int cpu;
 
 	cn = of_find_node_by_path("/cpus");
 	if (!cn) {
@@ -101,9 +43,6 @@ static void __init parse_dt_topology(void)
 	}
 
 	for_each_possible_cpu(cpu) {
-		const u32 *rate;
-		int len;
-
 		/* too early to use cpu->of_node */
 		cn = of_get_cpu_node(cpu, NULL);
 		if (!cn) {
@@ -111,76 +50,15 @@ static void __init parse_dt_topology(void)
 			continue;
 		}
 
-		if (topology_parse_cpu_capacity(cn, cpu)) {
+		if (topology_parse_cpu_capacity(cn, cpu))
 			of_node_put(cn);
-			continue;
-		}
-
-		cap_from_dt = false;
-
-		for (cpu_eff = table_efficiency; cpu_eff->compatible; cpu_eff++)
-			if (of_device_is_compatible(cn, cpu_eff->compatible))
-				break;
-
-		if (cpu_eff->compatible == NULL)
-			continue;
-
-		rate = of_get_property(cn, "clock-frequency", &len);
-		if (!rate || len != 4) {
-			pr_err("%pOF missing clock-frequency property\n", cn);
-			continue;
-		}
-
-		capacity = ((be32_to_cpup(rate)) >> 20) * cpu_eff->efficiency;
-
-		/* Save min capacity of the system */
-		if (capacity < min_capacity)
-			min_capacity = capacity;
-
-		/* Save max capacity of the system */
-		if (capacity > max_capacity)
-			max_capacity = capacity;
-
-		cpu_capacity(cpu) = capacity;
 	}
 
-	/* If min and max capacities are equals, we bypass the update of the
-	 * cpu_scale because all CPUs have the same capacity. Otherwise, we
-	 * compute a middle_capacity factor that will ensure that the capacity
-	 * of an 'average' CPU of the system will be as close as possible to
-	 * SCHED_CAPACITY_SCALE, which is the default value, but with the
-	 * constraint explained near table_efficiency[].
-	 */
-	if (4*max_capacity < (3*(max_capacity + min_capacity)))
-		middle_capacity = (min_capacity + max_capacity)
-				>> (SCHED_CAPACITY_SHIFT+1);
-	else
-		middle_capacity = ((max_capacity / 3)
-				>> (SCHED_CAPACITY_SHIFT-1)) + 1;
-
-	if (cap_from_dt)
-		topology_normalize_cpu_scale();
-}
-
-/*
- * Look for a customed capacity of a CPU in the cpu_capacity table during the
- * boot. The update of all CPUs is in O(n^2) for heteregeneous system but the
- * function returns directly for SMP system.
- */
-static void update_cpu_capacity(unsigned int cpu)
-{
-	if (!cpu_capacity(cpu) || cap_from_dt)
-		return;
-
-	topology_set_cpu_scale(cpu, cpu_capacity(cpu) / middle_capacity);
-
-	pr_info("CPU%u: update cpu_capacity %lu\n",
-		cpu, topology_get_cpu_scale(NULL, cpu));
+	topology_normalize_cpu_scale();
 }
 
 #else
 static inline void parse_dt_topology(void) {}
-static inline void update_cpu_capacity(unsigned int cpuid) {}
 #endif
 
  /*
@@ -276,8 +154,6 @@ void store_cpu_topology(unsigned int cpuid)
 
 	update_siblings_masks(cpuid);
 
-	update_cpu_capacity(cpuid);
-
 	pr_info("CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",
 		cpuid, cpu_topology[cpuid].thread_id,
 		cpu_topology[cpuid].core_id,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 1/1] arm: topology: remove cpu_efficiency
@ 2017-10-12 14:00   ` Dietmar Eggemann
  0 siblings, 0 replies; 10+ messages in thread
From: Dietmar Eggemann @ 2017-10-12 14:00 UTC (permalink / raw)
  To: linux-arm-kernel

Remove the 'cpu_efficiency/clock-frequency dt property' based solution
to set cpu capacity which was only working for Cortex-A15/A7 arm
big.LITTLE systems.

I.e. the 'capacity-dmips-mhz' based solution is now the only one. It is
shared between arm and arm64 and works for every big.LITTLE system no
matter which core types it consists of.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Juri Lelli <juri.lelli@gmail.com>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
---
 arch/arm/kernel/topology.c | 132 ++-------------------------------------------
 1 file changed, 4 insertions(+), 128 deletions(-)

diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 24ac3cab411d..15cc131ae387 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -30,69 +30,11 @@
 #include <asm/cputype.h>
 #include <asm/topology.h>
 
-/*
- * cpu capacity scale management
- */
-
-/*
- * cpu capacity table
- * This per cpu data structure describes the relative capacity of each core.
- * On a heteregenous system, cores don't have the same computation capacity
- * and we reflect that difference in the cpu_capacity field so the scheduler
- * can take this difference into account during load balance. A per cpu
- * structure is preferred because each CPU updates its own cpu_capacity field
- * during the load balance except for idle cores. One idle core is selected
- * to run the rebalance_domains for all idle cores and the cpu_capacity can be
- * updated during this sequence.
- */
-
 #ifdef CONFIG_OF
-struct cpu_efficiency {
-	const char *compatible;
-	unsigned long efficiency;
-};
-
-/*
- * Table of relative efficiency of each processors
- * The efficiency value must fit in 20bit and the final
- * cpu_scale value must be in the range
- *   0 < cpu_scale < 3*SCHED_CAPACITY_SCALE/2
- * in order to return@most 1 when DIV_ROUND_CLOSEST
- * is used to compute the capacity of a CPU.
- * Processors that are not defined in the table,
- * use the default SCHED_CAPACITY_SCALE value for cpu_scale.
- */
-static const struct cpu_efficiency table_efficiency[] = {
-	{"arm,cortex-a15", 3891},
-	{"arm,cortex-a7",  2048},
-	{NULL, },
-};
-
-static unsigned long *__cpu_capacity;
-#define cpu_capacity(cpu)	__cpu_capacity[cpu]
-
-static unsigned long middle_capacity = 1;
-static bool cap_from_dt = true;
-
-/*
- * Iterate all CPUs' descriptor in DT and compute the efficiency
- * (as per table_efficiency). Also calculate a middle efficiency
- * as close as possible to  (max{eff_i} - min{eff_i}) / 2
- * This is later used to scale the cpu_capacity field such that an
- * 'average' CPU is of middle capacity. Also see the comments near
- * table_efficiency[] and update_cpu_capacity().
- */
 static void __init parse_dt_topology(void)
 {
-	const struct cpu_efficiency *cpu_eff;
-	struct device_node *cn = NULL;
-	unsigned long min_capacity = ULONG_MAX;
-	unsigned long max_capacity = 0;
-	unsigned long capacity = 0;
-	int cpu = 0;
-
-	__cpu_capacity = kcalloc(nr_cpu_ids, sizeof(*__cpu_capacity),
-				 GFP_NOWAIT);
+	struct device_node *cn;
+	int cpu;
 
 	cn = of_find_node_by_path("/cpus");
 	if (!cn) {
@@ -101,9 +43,6 @@ static void __init parse_dt_topology(void)
 	}
 
 	for_each_possible_cpu(cpu) {
-		const u32 *rate;
-		int len;
-
 		/* too early to use cpu->of_node */
 		cn = of_get_cpu_node(cpu, NULL);
 		if (!cn) {
@@ -111,76 +50,15 @@ static void __init parse_dt_topology(void)
 			continue;
 		}
 
-		if (topology_parse_cpu_capacity(cn, cpu)) {
+		if (topology_parse_cpu_capacity(cn, cpu))
 			of_node_put(cn);
-			continue;
-		}
-
-		cap_from_dt = false;
-
-		for (cpu_eff = table_efficiency; cpu_eff->compatible; cpu_eff++)
-			if (of_device_is_compatible(cn, cpu_eff->compatible))
-				break;
-
-		if (cpu_eff->compatible == NULL)
-			continue;
-
-		rate = of_get_property(cn, "clock-frequency", &len);
-		if (!rate || len != 4) {
-			pr_err("%pOF missing clock-frequency property\n", cn);
-			continue;
-		}
-
-		capacity = ((be32_to_cpup(rate)) >> 20) * cpu_eff->efficiency;
-
-		/* Save min capacity of the system */
-		if (capacity < min_capacity)
-			min_capacity = capacity;
-
-		/* Save max capacity of the system */
-		if (capacity > max_capacity)
-			max_capacity = capacity;
-
-		cpu_capacity(cpu) = capacity;
 	}
 
-	/* If min and max capacities are equals, we bypass the update of the
-	 * cpu_scale because all CPUs have the same capacity. Otherwise, we
-	 * compute a middle_capacity factor that will ensure that the capacity
-	 * of an 'average' CPU of the system will be as close as possible to
-	 * SCHED_CAPACITY_SCALE, which is the default value, but with the
-	 * constraint explained near table_efficiency[].
-	 */
-	if (4*max_capacity < (3*(max_capacity + min_capacity)))
-		middle_capacity = (min_capacity + max_capacity)
-				>> (SCHED_CAPACITY_SHIFT+1);
-	else
-		middle_capacity = ((max_capacity / 3)
-				>> (SCHED_CAPACITY_SHIFT-1)) + 1;
-
-	if (cap_from_dt)
-		topology_normalize_cpu_scale();
-}
-
-/*
- * Look for a customed capacity of a CPU in the cpu_capacity table during the
- * boot. The update of all CPUs is in O(n^2) for heteregeneous system but the
- * function returns directly for SMP system.
- */
-static void update_cpu_capacity(unsigned int cpu)
-{
-	if (!cpu_capacity(cpu) || cap_from_dt)
-		return;
-
-	topology_set_cpu_scale(cpu, cpu_capacity(cpu) / middle_capacity);
-
-	pr_info("CPU%u: update cpu_capacity %lu\n",
-		cpu, topology_get_cpu_scale(NULL, cpu));
+	topology_normalize_cpu_scale();
 }
 
 #else
 static inline void parse_dt_topology(void) {}
-static inline void update_cpu_capacity(unsigned int cpuid) {}
 #endif
 
  /*
@@ -276,8 +154,6 @@ void store_cpu_topology(unsigned int cpuid)
 
 	update_siblings_masks(cpuid);
 
-	update_cpu_capacity(cpuid);
-
 	pr_info("CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",
 		cpuid, cpu_topology[cpuid].thread_id,
 		cpu_topology[cpuid].core_id,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/1] arm: topology: remove cpu_efficiency
  2017-10-12 14:00   ` Dietmar Eggemann
@ 2017-10-17 12:28     ` Vincent Guittot
  -1 siblings, 0 replies; 10+ messages in thread
From: Vincent Guittot @ 2017-10-17 12:28 UTC (permalink / raw)
  To: Dietmar Eggemann; +Cc: linux-kernel, LAK, Russell King, Juri Lelli

Hi Dietmar,

On 12 October 2017 at 16:00, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
> Remove the 'cpu_efficiency/clock-frequency dt property' based solution
> to set cpu capacity which was only working for Cortex-A15/A7 arm
> big.LITTLE systems.
>
> I.e. the 'capacity-dmips-mhz' based solution is now the only one. It is
> shared between arm and arm64 and works for every big.LITTLE system no
> matter which core types it consists of.
>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Juri Lelli <juri.lelli@gmail.com>
> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> ---
>  arch/arm/kernel/topology.c | 132 ++-------------------------------------------
>  1 file changed, 4 insertions(+), 128 deletions(-)
>
> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
> index 24ac3cab411d..15cc131ae387 100644
> --- a/arch/arm/kernel/topology.c
> +++ b/arch/arm/kernel/topology.c
> @@ -30,69 +30,11 @@
>  #include <asm/cputype.h>
>  #include <asm/topology.h>
>
> -/*
> - * cpu capacity scale management
> - */
> -
> -/*
> - * cpu capacity table
> - * This per cpu data structure describes the relative capacity of each core.
> - * On a heteregenous system, cores don't have the same computation capacity
> - * and we reflect that difference in the cpu_capacity field so the scheduler
> - * can take this difference into account during load balance. A per cpu
> - * structure is preferred because each CPU updates its own cpu_capacity field
> - * during the load balance except for idle cores. One idle core is selected
> - * to run the rebalance_domains for all idle cores and the cpu_capacity can be
> - * updated during this sequence.
> - */
> -
>  #ifdef CONFIG_OF
> -struct cpu_efficiency {
> -       const char *compatible;
> -       unsigned long efficiency;
> -};
> -
> -/*
> - * Table of relative efficiency of each processors
> - * The efficiency value must fit in 20bit and the final
> - * cpu_scale value must be in the range
> - *   0 < cpu_scale < 3*SCHED_CAPACITY_SCALE/2
> - * in order to return at most 1 when DIV_ROUND_CLOSEST
> - * is used to compute the capacity of a CPU.
> - * Processors that are not defined in the table,
> - * use the default SCHED_CAPACITY_SCALE value for cpu_scale.
> - */
> -static const struct cpu_efficiency table_efficiency[] = {
> -       {"arm,cortex-a15", 3891},
> -       {"arm,cortex-a7",  2048},
> -       {NULL, },
> -};
> -
> -static unsigned long *__cpu_capacity;
> -#define cpu_capacity(cpu)      __cpu_capacity[cpu]
> -
> -static unsigned long middle_capacity = 1;
> -static bool cap_from_dt = true;
> -
> -/*
> - * Iterate all CPUs' descriptor in DT and compute the efficiency
> - * (as per table_efficiency). Also calculate a middle efficiency
> - * as close as possible to  (max{eff_i} - min{eff_i}) / 2
> - * This is later used to scale the cpu_capacity field such that an
> - * 'average' CPU is of middle capacity. Also see the comments near
> - * table_efficiency[] and update_cpu_capacity().
> - */
>  static void __init parse_dt_topology(void)
>  {
> -       const struct cpu_efficiency *cpu_eff;
> -       struct device_node *cn = NULL;
> -       unsigned long min_capacity = ULONG_MAX;
> -       unsigned long max_capacity = 0;
> -       unsigned long capacity = 0;
> -       int cpu = 0;
> -
> -       __cpu_capacity = kcalloc(nr_cpu_ids, sizeof(*__cpu_capacity),
> -                                GFP_NOWAIT);
> +       struct device_node *cn;
> +       int cpu;
>
>         cn = of_find_node_by_path("/cpus");
>         if (!cn) {
> @@ -101,9 +43,6 @@ static void __init parse_dt_topology(void)
>         }
>
>         for_each_possible_cpu(cpu) {
> -               const u32 *rate;
> -               int len;
> -
>                 /* too early to use cpu->of_node */
>                 cn = of_get_cpu_node(cpu, NULL);
>                 if (!cn) {
> @@ -111,76 +50,15 @@ static void __init parse_dt_topology(void)
>                         continue;
>                 }
>
> -               if (topology_parse_cpu_capacity(cn, cpu)) {
> +               if (topology_parse_cpu_capacity(cn, cpu))
>                         of_node_put(cn);

We should call the of_node_put unconditionally  to balance the
of_get_cpu_node, isn't it ?
Note that this problem is also present without your change

> -                       continue;
> -               }
> -
> -               cap_from_dt = false;
> -
> -               for (cpu_eff = table_efficiency; cpu_eff->compatible; cpu_eff++)
> -                       if (of_device_is_compatible(cn, cpu_eff->compatible))
> -                               break;
> -
> -               if (cpu_eff->compatible == NULL)
> -                       continue;
> -
> -               rate = of_get_property(cn, "clock-frequency", &len);
> -               if (!rate || len != 4) {
> -                       pr_err("%pOF missing clock-frequency property\n", cn);
> -                       continue;
> -               }
> -
> -               capacity = ((be32_to_cpup(rate)) >> 20) * cpu_eff->efficiency;
> -
> -               /* Save min capacity of the system */
> -               if (capacity < min_capacity)
> -                       min_capacity = capacity;
> -
> -               /* Save max capacity of the system */
> -               if (capacity > max_capacity)
> -                       max_capacity = capacity;
> -
> -               cpu_capacity(cpu) = capacity;
>         }
>
> -       /* If min and max capacities are equals, we bypass the update of the
> -        * cpu_scale because all CPUs have the same capacity. Otherwise, we
> -        * compute a middle_capacity factor that will ensure that the capacity
> -        * of an 'average' CPU of the system will be as close as possible to
> -        * SCHED_CAPACITY_SCALE, which is the default value, but with the
> -        * constraint explained near table_efficiency[].
> -        */
> -       if (4*max_capacity < (3*(max_capacity + min_capacity)))
> -               middle_capacity = (min_capacity + max_capacity)
> -                               >> (SCHED_CAPACITY_SHIFT+1);
> -       else
> -               middle_capacity = ((max_capacity / 3)
> -                               >> (SCHED_CAPACITY_SHIFT-1)) + 1;
> -
> -       if (cap_from_dt)
> -               topology_normalize_cpu_scale();
> -}
> -
> -/*
> - * Look for a customed capacity of a CPU in the cpu_capacity table during the
> - * boot. The update of all CPUs is in O(n^2) for heteregeneous system but the
> - * function returns directly for SMP system.
> - */
> -static void update_cpu_capacity(unsigned int cpu)
> -{
> -       if (!cpu_capacity(cpu) || cap_from_dt)
> -               return;
> -
> -       topology_set_cpu_scale(cpu, cpu_capacity(cpu) / middle_capacity);
> -
> -       pr_info("CPU%u: update cpu_capacity %lu\n",
> -               cpu, topology_get_cpu_scale(NULL, cpu));
> +       topology_normalize_cpu_scale();
>  }
>
>  #else
>  static inline void parse_dt_topology(void) {}
> -static inline void update_cpu_capacity(unsigned int cpuid) {}
>  #endif
>
>   /*
> @@ -276,8 +154,6 @@ void store_cpu_topology(unsigned int cpuid)
>
>         update_siblings_masks(cpuid);
>
> -       update_cpu_capacity(cpuid);
> -
>         pr_info("CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",
>                 cpuid, cpu_topology[cpuid].thread_id,
>                 cpu_topology[cpuid].core_id,
> --
> 2.11.0
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/1] arm: topology: remove cpu_efficiency
@ 2017-10-17 12:28     ` Vincent Guittot
  0 siblings, 0 replies; 10+ messages in thread
From: Vincent Guittot @ 2017-10-17 12:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Dietmar,

On 12 October 2017 at 16:00, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
> Remove the 'cpu_efficiency/clock-frequency dt property' based solution
> to set cpu capacity which was only working for Cortex-A15/A7 arm
> big.LITTLE systems.
>
> I.e. the 'capacity-dmips-mhz' based solution is now the only one. It is
> shared between arm and arm64 and works for every big.LITTLE system no
> matter which core types it consists of.
>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Cc: Juri Lelli <juri.lelli@gmail.com>
> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> ---
>  arch/arm/kernel/topology.c | 132 ++-------------------------------------------
>  1 file changed, 4 insertions(+), 128 deletions(-)
>
> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
> index 24ac3cab411d..15cc131ae387 100644
> --- a/arch/arm/kernel/topology.c
> +++ b/arch/arm/kernel/topology.c
> @@ -30,69 +30,11 @@
>  #include <asm/cputype.h>
>  #include <asm/topology.h>
>
> -/*
> - * cpu capacity scale management
> - */
> -
> -/*
> - * cpu capacity table
> - * This per cpu data structure describes the relative capacity of each core.
> - * On a heteregenous system, cores don't have the same computation capacity
> - * and we reflect that difference in the cpu_capacity field so the scheduler
> - * can take this difference into account during load balance. A per cpu
> - * structure is preferred because each CPU updates its own cpu_capacity field
> - * during the load balance except for idle cores. One idle core is selected
> - * to run the rebalance_domains for all idle cores and the cpu_capacity can be
> - * updated during this sequence.
> - */
> -
>  #ifdef CONFIG_OF
> -struct cpu_efficiency {
> -       const char *compatible;
> -       unsigned long efficiency;
> -};
> -
> -/*
> - * Table of relative efficiency of each processors
> - * The efficiency value must fit in 20bit and the final
> - * cpu_scale value must be in the range
> - *   0 < cpu_scale < 3*SCHED_CAPACITY_SCALE/2
> - * in order to return at most 1 when DIV_ROUND_CLOSEST
> - * is used to compute the capacity of a CPU.
> - * Processors that are not defined in the table,
> - * use the default SCHED_CAPACITY_SCALE value for cpu_scale.
> - */
> -static const struct cpu_efficiency table_efficiency[] = {
> -       {"arm,cortex-a15", 3891},
> -       {"arm,cortex-a7",  2048},
> -       {NULL, },
> -};
> -
> -static unsigned long *__cpu_capacity;
> -#define cpu_capacity(cpu)      __cpu_capacity[cpu]
> -
> -static unsigned long middle_capacity = 1;
> -static bool cap_from_dt = true;
> -
> -/*
> - * Iterate all CPUs' descriptor in DT and compute the efficiency
> - * (as per table_efficiency). Also calculate a middle efficiency
> - * as close as possible to  (max{eff_i} - min{eff_i}) / 2
> - * This is later used to scale the cpu_capacity field such that an
> - * 'average' CPU is of middle capacity. Also see the comments near
> - * table_efficiency[] and update_cpu_capacity().
> - */
>  static void __init parse_dt_topology(void)
>  {
> -       const struct cpu_efficiency *cpu_eff;
> -       struct device_node *cn = NULL;
> -       unsigned long min_capacity = ULONG_MAX;
> -       unsigned long max_capacity = 0;
> -       unsigned long capacity = 0;
> -       int cpu = 0;
> -
> -       __cpu_capacity = kcalloc(nr_cpu_ids, sizeof(*__cpu_capacity),
> -                                GFP_NOWAIT);
> +       struct device_node *cn;
> +       int cpu;
>
>         cn = of_find_node_by_path("/cpus");
>         if (!cn) {
> @@ -101,9 +43,6 @@ static void __init parse_dt_topology(void)
>         }
>
>         for_each_possible_cpu(cpu) {
> -               const u32 *rate;
> -               int len;
> -
>                 /* too early to use cpu->of_node */
>                 cn = of_get_cpu_node(cpu, NULL);
>                 if (!cn) {
> @@ -111,76 +50,15 @@ static void __init parse_dt_topology(void)
>                         continue;
>                 }
>
> -               if (topology_parse_cpu_capacity(cn, cpu)) {
> +               if (topology_parse_cpu_capacity(cn, cpu))
>                         of_node_put(cn);

We should call the of_node_put unconditionally  to balance the
of_get_cpu_node, isn't it ?
Note that this problem is also present without your change

> -                       continue;
> -               }
> -
> -               cap_from_dt = false;
> -
> -               for (cpu_eff = table_efficiency; cpu_eff->compatible; cpu_eff++)
> -                       if (of_device_is_compatible(cn, cpu_eff->compatible))
> -                               break;
> -
> -               if (cpu_eff->compatible == NULL)
> -                       continue;
> -
> -               rate = of_get_property(cn, "clock-frequency", &len);
> -               if (!rate || len != 4) {
> -                       pr_err("%pOF missing clock-frequency property\n", cn);
> -                       continue;
> -               }
> -
> -               capacity = ((be32_to_cpup(rate)) >> 20) * cpu_eff->efficiency;
> -
> -               /* Save min capacity of the system */
> -               if (capacity < min_capacity)
> -                       min_capacity = capacity;
> -
> -               /* Save max capacity of the system */
> -               if (capacity > max_capacity)
> -                       max_capacity = capacity;
> -
> -               cpu_capacity(cpu) = capacity;
>         }
>
> -       /* If min and max capacities are equals, we bypass the update of the
> -        * cpu_scale because all CPUs have the same capacity. Otherwise, we
> -        * compute a middle_capacity factor that will ensure that the capacity
> -        * of an 'average' CPU of the system will be as close as possible to
> -        * SCHED_CAPACITY_SCALE, which is the default value, but with the
> -        * constraint explained near table_efficiency[].
> -        */
> -       if (4*max_capacity < (3*(max_capacity + min_capacity)))
> -               middle_capacity = (min_capacity + max_capacity)
> -                               >> (SCHED_CAPACITY_SHIFT+1);
> -       else
> -               middle_capacity = ((max_capacity / 3)
> -                               >> (SCHED_CAPACITY_SHIFT-1)) + 1;
> -
> -       if (cap_from_dt)
> -               topology_normalize_cpu_scale();
> -}
> -
> -/*
> - * Look for a customed capacity of a CPU in the cpu_capacity table during the
> - * boot. The update of all CPUs is in O(n^2) for heteregeneous system but the
> - * function returns directly for SMP system.
> - */
> -static void update_cpu_capacity(unsigned int cpu)
> -{
> -       if (!cpu_capacity(cpu) || cap_from_dt)
> -               return;
> -
> -       topology_set_cpu_scale(cpu, cpu_capacity(cpu) / middle_capacity);
> -
> -       pr_info("CPU%u: update cpu_capacity %lu\n",
> -               cpu, topology_get_cpu_scale(NULL, cpu));
> +       topology_normalize_cpu_scale();
>  }
>
>  #else
>  static inline void parse_dt_topology(void) {}
> -static inline void update_cpu_capacity(unsigned int cpuid) {}
>  #endif
>
>   /*
> @@ -276,8 +154,6 @@ void store_cpu_topology(unsigned int cpuid)
>
>         update_siblings_masks(cpuid);
>
> -       update_cpu_capacity(cpuid);
> -
>         pr_info("CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",
>                 cpuid, cpu_topology[cpuid].thread_id,
>                 cpu_topology[cpuid].core_id,
> --
> 2.11.0
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/1] arm: topology: remove cpu_efficiency
  2017-10-17 12:28     ` Vincent Guittot
@ 2017-10-18 10:37       ` Dietmar Eggemann
  -1 siblings, 0 replies; 10+ messages in thread
From: Dietmar Eggemann @ 2017-10-18 10:37 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: linux-kernel, LAK, Russell King, Juri Lelli, Brendan Jackman

Hi Vincent,

On 17/10/17 13:28, Vincent Guittot wrote:
> Hi Dietmar,
> 
> On 12 October 2017 at 16:00, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
>> Remove the 'cpu_efficiency/clock-frequency dt property' based solution
>> to set cpu capacity which was only working for Cortex-A15/A7 arm
>> big.LITTLE systems.
>>
>> I.e. the 'capacity-dmips-mhz' based solution is now the only one. It is
>> shared between arm and arm64 and works for every big.LITTLE system no
>> matter which core types it consists of.
>>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> Cc: Vincent Guittot <vincent.guittot@linaro.org>
>> Cc: Juri Lelli <juri.lelli@gmail.com>
>> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>

[...]

>> @@ -111,76 +50,15 @@ static void __init parse_dt_topology(void)
>>                         continue;
>>                 }
>>
>> -               if (topology_parse_cpu_capacity(cn, cpu)) {
>> +               if (topology_parse_cpu_capacity(cn, cpu))
>>                         of_node_put(cn);
> 
> We should call the of_node_put unconditionally  to balance the
> of_get_cpu_node, isn't it ?
> Note that this problem is also present without your change

Thanks for the review. Brendan mentioned this the other day already.

I could add an additional patch to the v3 with this code change. What do
you think?

diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 15cc131ae387..81ec42333489 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -41,6 +41,7 @@ static void __init parse_dt_topology(void)
                pr_err("No CPU information found in DT\n");
                return;
        }
+       of_node_put(cn);

        for_each_possible_cpu(cpu) {
                /* too early to use cpu->of_node */
@@ -50,8 +51,8 @@ static void __init parse_dt_topology(void)
                        continue;
                }

-               if (topology_parse_cpu_capacity(cn, cpu))
-                       of_node_put(cn);
+               topology_parse_cpu_capacity(cn, cpu);
+               of_node_put(cn);
        }

        topology_normalize_cpu_scale();

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 1/1] arm: topology: remove cpu_efficiency
@ 2017-10-18 10:37       ` Dietmar Eggemann
  0 siblings, 0 replies; 10+ messages in thread
From: Dietmar Eggemann @ 2017-10-18 10:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Vincent,

On 17/10/17 13:28, Vincent Guittot wrote:
> Hi Dietmar,
> 
> On 12 October 2017 at 16:00, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
>> Remove the 'cpu_efficiency/clock-frequency dt property' based solution
>> to set cpu capacity which was only working for Cortex-A15/A7 arm
>> big.LITTLE systems.
>>
>> I.e. the 'capacity-dmips-mhz' based solution is now the only one. It is
>> shared between arm and arm64 and works for every big.LITTLE system no
>> matter which core types it consists of.
>>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> Cc: Vincent Guittot <vincent.guittot@linaro.org>
>> Cc: Juri Lelli <juri.lelli@gmail.com>
>> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>

[...]

>> @@ -111,76 +50,15 @@ static void __init parse_dt_topology(void)
>>                         continue;
>>                 }
>>
>> -               if (topology_parse_cpu_capacity(cn, cpu)) {
>> +               if (topology_parse_cpu_capacity(cn, cpu))
>>                         of_node_put(cn);
> 
> We should call the of_node_put unconditionally  to balance the
> of_get_cpu_node, isn't it ?
> Note that this problem is also present without your change

Thanks for the review. Brendan mentioned this the other day already.

I could add an additional patch to the v3 with this code change. What do
you think?

diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 15cc131ae387..81ec42333489 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -41,6 +41,7 @@ static void __init parse_dt_topology(void)
                pr_err("No CPU information found in DT\n");
                return;
        }
+       of_node_put(cn);

        for_each_possible_cpu(cpu) {
                /* too early to use cpu->of_node */
@@ -50,8 +51,8 @@ static void __init parse_dt_topology(void)
                        continue;
                }

-               if (topology_parse_cpu_capacity(cn, cpu))
-                       of_node_put(cn);
+               topology_parse_cpu_capacity(cn, cpu);
+               of_node_put(cn);
        }

        topology_normalize_cpu_scale();

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/1] arm: topology: remove cpu_efficiency
  2017-10-18 10:37       ` Dietmar Eggemann
@ 2017-10-19  7:32         ` Vincent Guittot
  -1 siblings, 0 replies; 10+ messages in thread
From: Vincent Guittot @ 2017-10-19  7:32 UTC (permalink / raw)
  To: Dietmar Eggemann
  Cc: linux-kernel, LAK, Russell King, Juri Lelli, Brendan Jackman

Hi Dietmar,

On 18 October 2017 at 12:37, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
> Hi Vincent,
>
> On 17/10/17 13:28, Vincent Guittot wrote:
>> Hi Dietmar,
>>
>> On 12 October 2017 at 16:00, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
>>> Remove the 'cpu_efficiency/clock-frequency dt property' based solution
>>> to set cpu capacity which was only working for Cortex-A15/A7 arm
>>> big.LITTLE systems.
>>>
>>> I.e. the 'capacity-dmips-mhz' based solution is now the only one. It is
>>> shared between arm and arm64 and works for every big.LITTLE system no
>>> matter which core types it consists of.
>>>
>>> Cc: Russell King <linux@arm.linux.org.uk>
>>> Cc: Vincent Guittot <vincent.guittot@linaro.org>
>>> Cc: Juri Lelli <juri.lelli@gmail.com>
>>> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
>
> [...]
>
>>> @@ -111,76 +50,15 @@ static void __init parse_dt_topology(void)
>>>                         continue;
>>>                 }
>>>
>>> -               if (topology_parse_cpu_capacity(cn, cpu)) {
>>> +               if (topology_parse_cpu_capacity(cn, cpu))
>>>                         of_node_put(cn);
>>
>> We should call the of_node_put unconditionally  to balance the
>> of_get_cpu_node, isn't it ?
>> Note that this problem is also present without your change
>
> Thanks for the review. Brendan mentioned this the other day already.
>
> I could add an additional patch to the v3 with this code change. What do
> you think?

The changes looks good to me

>
> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
> index 15cc131ae387..81ec42333489 100644
> --- a/arch/arm/kernel/topology.c
> +++ b/arch/arm/kernel/topology.c
> @@ -41,6 +41,7 @@ static void __init parse_dt_topology(void)
>                 pr_err("No CPU information found in DT\n");
>                 return;
>         }
> +       of_node_put(cn);
>
>         for_each_possible_cpu(cpu) {
>                 /* too early to use cpu->of_node */
> @@ -50,8 +51,8 @@ static void __init parse_dt_topology(void)
>                         continue;
>                 }
>
> -               if (topology_parse_cpu_capacity(cn, cpu))
> -                       of_node_put(cn);
> +               topology_parse_cpu_capacity(cn, cpu);
> +               of_node_put(cn);
>         }
>
>         topology_normalize_cpu_scale();
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/1] arm: topology: remove cpu_efficiency
@ 2017-10-19  7:32         ` Vincent Guittot
  0 siblings, 0 replies; 10+ messages in thread
From: Vincent Guittot @ 2017-10-19  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Dietmar,

On 18 October 2017 at 12:37, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
> Hi Vincent,
>
> On 17/10/17 13:28, Vincent Guittot wrote:
>> Hi Dietmar,
>>
>> On 12 October 2017 at 16:00, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
>>> Remove the 'cpu_efficiency/clock-frequency dt property' based solution
>>> to set cpu capacity which was only working for Cortex-A15/A7 arm
>>> big.LITTLE systems.
>>>
>>> I.e. the 'capacity-dmips-mhz' based solution is now the only one. It is
>>> shared between arm and arm64 and works for every big.LITTLE system no
>>> matter which core types it consists of.
>>>
>>> Cc: Russell King <linux@arm.linux.org.uk>
>>> Cc: Vincent Guittot <vincent.guittot@linaro.org>
>>> Cc: Juri Lelli <juri.lelli@gmail.com>
>>> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
>
> [...]
>
>>> @@ -111,76 +50,15 @@ static void __init parse_dt_topology(void)
>>>                         continue;
>>>                 }
>>>
>>> -               if (topology_parse_cpu_capacity(cn, cpu)) {
>>> +               if (topology_parse_cpu_capacity(cn, cpu))
>>>                         of_node_put(cn);
>>
>> We should call the of_node_put unconditionally  to balance the
>> of_get_cpu_node, isn't it ?
>> Note that this problem is also present without your change
>
> Thanks for the review. Brendan mentioned this the other day already.
>
> I could add an additional patch to the v3 with this code change. What do
> you think?

The changes looks good to me

>
> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
> index 15cc131ae387..81ec42333489 100644
> --- a/arch/arm/kernel/topology.c
> +++ b/arch/arm/kernel/topology.c
> @@ -41,6 +41,7 @@ static void __init parse_dt_topology(void)
>                 pr_err("No CPU information found in DT\n");
>                 return;
>         }
> +       of_node_put(cn);
>
>         for_each_possible_cpu(cpu) {
>                 /* too early to use cpu->of_node */
> @@ -50,8 +51,8 @@ static void __init parse_dt_topology(void)
>                         continue;
>                 }
>
> -               if (topology_parse_cpu_capacity(cn, cpu))
> -                       of_node_put(cn);
> +               topology_parse_cpu_capacity(cn, cpu);
> +               of_node_put(cn);
>         }
>
>         topology_normalize_cpu_scale();
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-10-19  7:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 14:00 [PATCH v2 0/1] arm: remove cpu_efficiency Dietmar Eggemann
2017-10-12 14:00 ` Dietmar Eggemann
2017-10-12 14:00 ` [PATCH v2 1/1] arm: topology: " Dietmar Eggemann
2017-10-12 14:00   ` Dietmar Eggemann
2017-10-17 12:28   ` Vincent Guittot
2017-10-17 12:28     ` Vincent Guittot
2017-10-18 10:37     ` Dietmar Eggemann
2017-10-18 10:37       ` Dietmar Eggemann
2017-10-19  7:32       ` Vincent Guittot
2017-10-19  7:32         ` Vincent Guittot

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.