* [PATCH] arm64: dts: qcom: sdm845: correct dynamic power coefficients
@ 2022-03-15 14:11 Dmitry Baryshkov
0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2022-03-15 14:11 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Rob Herring, Krzysztof Kozlowski
Cc: linux-arm-msm, devicetree, Danny Lin
Following sm8150/sm8250 update sdm845 capacity-dmips-mhz and
dynamic-power-coefficient based on the measurements [1], [2].
The energy model dynamic-power-coefficient values were calculated with
DPC = µW / MHz / V^2
for each OPP, and averaged across all OPPs within each cluster for the
final coefficient. Voltages were obtained from the qcom-cpufreq-hw
driver that reads voltages from the OSM LUT programmed into the SoC.
Normalized DMIPS/MHz capacity scale values for each CPU were calculated
from CoreMarks/MHz (CoreMark iterations per second per MHz), which
serves the same purpose. For each CPU, the final capacity-dmips-mhz
value is the C/MHz value of its maximum frequency normalized to
SCHED_CAPACITY_SCALE (1024) for the fastest CPU in the system.
For more details on measurement process see the commit message for the
commit 6aabed5526ee ("arm64: dts: qcom: sm8250: Add CPU capacities and
energy model").
[1] https://github.com/kdrag0n/freqbench
[2] https://github.com/kdrag0n/freqbench/tree/master/results/sdm845/main
Cc: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
arch/arm64/boot/dts/qcom/sdm845.dtsi | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 41f4e46e1f85..f5932b49877d 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -200,8 +200,8 @@ CPU0: cpu@0 {
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
&LITTLE_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
- capacity-dmips-mhz = <607>;
- dynamic-power-coefficient = <100>;
+ capacity-dmips-mhz = <611>;
+ dynamic-power-coefficient = <290>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -225,8 +225,8 @@ CPU1: cpu@100 {
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
&LITTLE_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
- capacity-dmips-mhz = <607>;
- dynamic-power-coefficient = <100>;
+ capacity-dmips-mhz = <611>;
+ dynamic-power-coefficient = <290>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -247,8 +247,8 @@ CPU2: cpu@200 {
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
&LITTLE_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
- capacity-dmips-mhz = <607>;
- dynamic-power-coefficient = <100>;
+ capacity-dmips-mhz = <611>;
+ dynamic-power-coefficient = <290>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -269,8 +269,8 @@ CPU3: cpu@300 {
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
&LITTLE_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
- capacity-dmips-mhz = <607>;
- dynamic-power-coefficient = <100>;
+ capacity-dmips-mhz = <611>;
+ dynamic-power-coefficient = <290>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -292,7 +292,7 @@ CPU4: cpu@400 {
cpu-idle-states = <&BIG_CPU_SLEEP_0
&BIG_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
- dynamic-power-coefficient = <396>;
+ dynamic-power-coefficient = <442>;
qcom,freq-domain = <&cpufreq_hw 1>;
operating-points-v2 = <&cpu4_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -314,7 +314,7 @@ CPU5: cpu@500 {
cpu-idle-states = <&BIG_CPU_SLEEP_0
&BIG_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
- dynamic-power-coefficient = <396>;
+ dynamic-power-coefficient = <442>;
qcom,freq-domain = <&cpufreq_hw 1>;
operating-points-v2 = <&cpu4_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -336,7 +336,7 @@ CPU6: cpu@600 {
cpu-idle-states = <&BIG_CPU_SLEEP_0
&BIG_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
- dynamic-power-coefficient = <396>;
+ dynamic-power-coefficient = <442>;
qcom,freq-domain = <&cpufreq_hw 1>;
operating-points-v2 = <&cpu4_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -358,7 +358,7 @@ CPU7: cpu@700 {
cpu-idle-states = <&BIG_CPU_SLEEP_0
&BIG_CPU_SLEEP_1
&CLUSTER_SLEEP_0>;
- dynamic-power-coefficient = <396>;
+ dynamic-power-coefficient = <442>;
qcom,freq-domain = <&cpufreq_hw 1>;
operating-points-v2 = <&cpu4_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
--
2.35.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] arm64: dts: qcom: sdm845: correct dynamic power coefficients
@ 2023-01-06 16:43 Vincent Guittot
0 siblings, 0 replies; 9+ messages in thread
From: Vincent Guittot @ 2023-01-06 16:43 UTC (permalink / raw)
To: dmitry.baryshkov, agross, bjorn.andersson, konrad.dybcio, robh+dt,
krzysztof.kozlowski+dt, linux-arm-msm, devicetree
Cc: danny, Vincent Guittot
While stressing EAS on my dragonboard RB3, I have noticed that LITTLE cores
where never selected as the most energy efficient CPU whatever the
utilization level of waking task.
energy model framework uses its cost field to estimate the energy with
the formula:
nrg = cost of the selected OPP * utilization / CPU's max capacity
which ends up selecting the CPU with lowest cost / max capacity ration
as long as the utilization fits in the OPP's capacity.
If we compare the cost of a little OPP with similar capacity of a big OPP
like :
OPP(kHz) OPP capacity cost max capacity cost/max capacity
LITTLE 1766400 407 351114 407 863
big 1056000 408 520267 1024 508
This can be interpreted as the LITTLE core consumes 70% more than big core
for the same compute capacity.
According to [1], LITTLE consumes 10% less than big core for Coremark
benchmark at those OPPs. If we consider that everything else stays
unchanged, the dynamic-power-coefficient of LITTLE core should be
only 53% of the current value: 290 * 53% = 154
Set the dynamic-power-coefficient of CPU0-3 to 154 to fix the energy model.
[1] https://github.com/kdrag0n/freqbench/tree/master/results/sdm845/main
Fixes: 0e0a8e35d725 ("arm64: dts: qcom: sdm845: correct dynamic power coefficients")
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 65032b94b46d..869bdb9bce6e 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -198,7 +198,7 @@ CPU0: cpu@0 {
reg = <0x0 0x0>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -222,7 +222,7 @@ CPU1: cpu@100 {
reg = <0x0 0x100>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -243,7 +243,7 @@ CPU2: cpu@200 {
reg = <0x0 0x200>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -264,7 +264,7 @@ CPU3: cpu@300 {
reg = <0x0 0x300>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] arm64: dts: qcom: sdm845: correct dynamic power coefficients
@ 2023-01-06 16:45 Vincent Guittot
0 siblings, 0 replies; 9+ messages in thread
From: Vincent Guittot @ 2023-01-06 16:45 UTC (permalink / raw)
To: dmitry.baryshkov, agross, bjorande, konrad.dybcio, robh+dt,
krzysztof.kozlowski+dt, linux-arm-msm, devicetree
Cc: danny, Vincent Guittot
While stressing EAS on my dragonboard RB3, I have noticed that LITTLE cores
where never selected as the most energy efficient CPU whatever the
utilization level of waking task.
energy model framework uses its cost field to estimate the energy with
the formula:
nrg = cost of the selected OPP * utilization / CPU's max capacity
which ends up selecting the CPU with lowest cost / max capacity ration
as long as the utilization fits in the OPP's capacity.
If we compare the cost of a little OPP with similar capacity of a big OPP
like :
OPP(kHz) OPP capacity cost max capacity cost/max capacity
LITTLE 1766400 407 351114 407 863
big 1056000 408 520267 1024 508
This can be interpreted as the LITTLE core consumes 70% more than big core
for the same compute capacity.
According to [1], LITTLE consumes 10% less than big core for Coremark
benchmark at those OPPs. If we consider that everything else stays
unchanged, the dynamic-power-coefficient of LITTLE core should be
only 53% of the current value: 290 * 53% = 154
Set the dynamic-power-coefficient of CPU0-3 to 154 to fix the energy model.
[1] https://github.com/kdrag0n/freqbench/tree/master/results/sdm845/main
Fixes: 0e0a8e35d725 ("arm64: dts: qcom: sdm845: correct dynamic power coefficients")
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 65032b94b46d..869bdb9bce6e 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -198,7 +198,7 @@ CPU0: cpu@0 {
reg = <0x0 0x0>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -222,7 +222,7 @@ CPU1: cpu@100 {
reg = <0x0 0x100>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -243,7 +243,7 @@ CPU2: cpu@200 {
reg = <0x0 0x200>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -264,7 +264,7 @@ CPU3: cpu@300 {
reg = <0x0 0x300>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] arm64: dts: qcom: sdm845: correct dynamic power coefficients
@ 2023-01-06 16:46 Vincent Guittot
2023-01-06 18:28 ` Bjorn Andersson
2023-03-16 3:21 ` Bjorn Andersson
0 siblings, 2 replies; 9+ messages in thread
From: Vincent Guittot @ 2023-01-06 16:46 UTC (permalink / raw)
To: dmitry.baryshkov, agross, andersson, konrad.dybcio, robh+dt,
krzysztof.kozlowski+dt, linux-arm-msm, devicetree
Cc: danny, Vincent Guittot
While stressing EAS on my dragonboard RB3, I have noticed that LITTLE cores
where never selected as the most energy efficient CPU whatever the
utilization level of waking task.
energy model framework uses its cost field to estimate the energy with
the formula:
nrg = cost of the selected OPP * utilization / CPU's max capacity
which ends up selecting the CPU with lowest cost / max capacity ration
as long as the utilization fits in the OPP's capacity.
If we compare the cost of a little OPP with similar capacity of a big OPP
like :
OPP(kHz) OPP capacity cost max capacity cost/max capacity
LITTLE 1766400 407 351114 407 863
big 1056000 408 520267 1024 508
This can be interpreted as the LITTLE core consumes 70% more than big core
for the same compute capacity.
According to [1], LITTLE consumes 10% less than big core for Coremark
benchmark at those OPPs. If we consider that everything else stays
unchanged, the dynamic-power-coefficient of LITTLE core should be
only 53% of the current value: 290 * 53% = 154
Set the dynamic-power-coefficient of CPU0-3 to 154 to fix the energy model.
[1] https://github.com/kdrag0n/freqbench/tree/master/results/sdm845/main
Fixes: 0e0a8e35d725 ("arm64: dts: qcom: sdm845: correct dynamic power coefficients")
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 65032b94b46d..869bdb9bce6e 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -198,7 +198,7 @@ CPU0: cpu@0 {
reg = <0x0 0x0>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -222,7 +222,7 @@ CPU1: cpu@100 {
reg = <0x0 0x100>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -243,7 +243,7 @@ CPU2: cpu@200 {
reg = <0x0 0x200>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -264,7 +264,7 @@ CPU3: cpu@300 {
reg = <0x0 0x300>;
enable-method = "psci";
capacity-dmips-mhz = <611>;
- dynamic-power-coefficient = <290>;
+ dynamic-power-coefficient = <154>;
qcom,freq-domain = <&cpufreq_hw 0>;
operating-points-v2 = <&cpu0_opp_table>;
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] arm64: dts: qcom: sdm845: correct dynamic power coefficients
2023-01-06 16:46 Vincent Guittot
@ 2023-01-06 18:28 ` Bjorn Andersson
2023-01-09 17:02 ` Vincent Guittot
2023-03-16 3:21 ` Bjorn Andersson
1 sibling, 1 reply; 9+ messages in thread
From: Bjorn Andersson @ 2023-01-06 18:28 UTC (permalink / raw)
To: Vincent Guittot
Cc: dmitry.baryshkov, agross, konrad.dybcio, robh+dt,
krzysztof.kozlowski+dt, linux-arm-msm, devicetree, danny
On Fri, Jan 06, 2023 at 05:46:18PM +0100, Vincent Guittot wrote:
Seems like using get_maintainer.pl would have saved you some trouble ;)
> While stressing EAS on my dragonboard RB3, I have noticed that LITTLE cores
> where never selected as the most energy efficient CPU whatever the
> utilization level of waking task.
>
> energy model framework uses its cost field to estimate the energy with
> the formula:
>
> nrg = cost of the selected OPP * utilization / CPU's max capacity
>
> which ends up selecting the CPU with lowest cost / max capacity ration
> as long as the utilization fits in the OPP's capacity.
>
> If we compare the cost of a little OPP with similar capacity of a big OPP
> like :
> OPP(kHz) OPP capacity cost max capacity cost/max capacity
> LITTLE 1766400 407 351114 407 863
> big 1056000 408 520267 1024 508
>
> This can be interpreted as the LITTLE core consumes 70% more than big core
> for the same compute capacity.
>
> According to [1], LITTLE consumes 10% less than big core for Coremark
> benchmark at those OPPs. If we consider that everything else stays
> unchanged, the dynamic-power-coefficient of LITTLE core should be
> only 53% of the current value: 290 * 53% = 154
>
> Set the dynamic-power-coefficient of CPU0-3 to 154 to fix the energy model.
>
This is sounds reasonable.
But if the math was wrong for SDM845, I would assume that sm8150 and
sm8250 are wrong as well, as that's what 0e0a8e35d725 is based on. And
should I assume that patches for other platforms are off by 53% as well?
Can you help me understand how to arrive at this number? (Without
considering everything else stays unchanged, if needed).
Regards,
Bjorn
> [1] https://github.com/kdrag0n/freqbench/tree/master/results/sdm845/main
>
> Fixes: 0e0a8e35d725 ("arm64: dts: qcom: sdm845: correct dynamic power coefficients")
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 65032b94b46d..869bdb9bce6e 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -198,7 +198,7 @@ CPU0: cpu@0 {
> reg = <0x0 0x0>;
> enable-method = "psci";
> capacity-dmips-mhz = <611>;
> - dynamic-power-coefficient = <290>;
> + dynamic-power-coefficient = <154>;
> qcom,freq-domain = <&cpufreq_hw 0>;
> operating-points-v2 = <&cpu0_opp_table>;
> interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> @@ -222,7 +222,7 @@ CPU1: cpu@100 {
> reg = <0x0 0x100>;
> enable-method = "psci";
> capacity-dmips-mhz = <611>;
> - dynamic-power-coefficient = <290>;
> + dynamic-power-coefficient = <154>;
> qcom,freq-domain = <&cpufreq_hw 0>;
> operating-points-v2 = <&cpu0_opp_table>;
> interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> @@ -243,7 +243,7 @@ CPU2: cpu@200 {
> reg = <0x0 0x200>;
> enable-method = "psci";
> capacity-dmips-mhz = <611>;
> - dynamic-power-coefficient = <290>;
> + dynamic-power-coefficient = <154>;
> qcom,freq-domain = <&cpufreq_hw 0>;
> operating-points-v2 = <&cpu0_opp_table>;
> interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> @@ -264,7 +264,7 @@ CPU3: cpu@300 {
> reg = <0x0 0x300>;
> enable-method = "psci";
> capacity-dmips-mhz = <611>;
> - dynamic-power-coefficient = <290>;
> + dynamic-power-coefficient = <154>;
> qcom,freq-domain = <&cpufreq_hw 0>;
> operating-points-v2 = <&cpu0_opp_table>;
> interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] arm64: dts: qcom: sdm845: correct dynamic power coefficients
2023-01-06 18:28 ` Bjorn Andersson
@ 2023-01-09 17:02 ` Vincent Guittot
2023-01-18 23:26 ` Bjorn Andersson
0 siblings, 1 reply; 9+ messages in thread
From: Vincent Guittot @ 2023-01-09 17:02 UTC (permalink / raw)
To: Bjorn Andersson
Cc: dmitry.baryshkov, agross, konrad.dybcio, robh+dt,
krzysztof.kozlowski+dt, linux-arm-msm, devicetree, danny
[-- Attachment #1: Type: text/plain, Size: 7138 bytes --]
On Fri, 6 Jan 2023 at 19:28, Bjorn Andersson <andersson@kernel.org> wrote:
>
> On Fri, Jan 06, 2023 at 05:46:18PM +0100, Vincent Guittot wrote:
>
> Seems like using get_maintainer.pl would have saved you some trouble ;)
The worst is that I used it but only checked names and not emails
when I reused the list of the original patch :-(
>
> > While stressing EAS on my dragonboard RB3, I have noticed that LITTLE cores
> > where never selected as the most energy efficient CPU whatever the
> > utilization level of waking task.
> >
> > energy model framework uses its cost field to estimate the energy with
> > the formula:
> >
> > nrg = cost of the selected OPP * utilization / CPU's max capacity
> >
> > which ends up selecting the CPU with lowest cost / max capacity ration
> > as long as the utilization fits in the OPP's capacity.
> >
> > If we compare the cost of a little OPP with similar capacity of a big OPP
> > like :
> > OPP(kHz) OPP capacity cost max capacity cost/max capacity
> > LITTLE 1766400 407 351114 407 863
> > big 1056000 408 520267 1024 508
> >
> > This can be interpreted as the LITTLE core consumes 70% more than big core
> > for the same compute capacity.
> >
> > According to [1], LITTLE consumes 10% less than big core for Coremark
> > benchmark at those OPPs. If we consider that everything else stays
> > unchanged, the dynamic-power-coefficient of LITTLE core should be
> > only 53% of the current value: 290 * 53% = 154
> >
> > Set the dynamic-power-coefficient of CPU0-3 to 154 to fix the energy model.
> >
>
> This is sounds reasonable.
>
> But if the math was wrong for SDM845, I would assume that sm8150 and
> sm8250 are wrong as well, as that's what 0e0a8e35d725 is based on. And
> should I assume that patches for other platforms are off by 53% as well?
I don't think that we can assume that there is an error and in
particular the same 53% error for others.
>
> Can you help me understand how to arrive at this number? (Without
> considering everything else stays unchanged, if needed).
In order to do the full computation, we need the voltage of each OPP
which I don't have as they are provided by the LUT at boot IIUC.
Instead I have used the debugfs output of the energy model and
compared the value of (perf_state->cost/cpu_max_capacity) with the
energy and duration figures available in [1].
In the case of SDM845, it was pretty easy to compare the OPPs of big
and LITTLE because the duration and the perf result were the same for
2 OPPS so we should have :
(little OPP(1766400)->cost / little max capacity (407)) / (big
OPP(1056000)->cost / big max capacity(1024)) = little OPP(1766400)
energy / big OPP(1056000) energy
(little OPP(1766400)->cost / little max capacity (407)) / (big
OPP(1056000)->cost / big max capacity(1024)) = 0.90
but current output gives:
(little OPP(1766400)->cost / little max capacity (407)) / (big
OPP(1056000)->cost / big max capacity(1024)) = 1.70
As we consider everything else constant, it can be simplified by:
correct_little_dynamic-power-coefficient * const_A = 0.90
Whereas we currently have
current_little_dynamic-power-coefficient * const_A = 1.70
and we ends up with
correct_little_dynamic-power-coefficient = 0.90 / 1.70 *
current_little_dynamic-power-coefficient = 154
That being said, it can be simpler as the energy model provide the power figures
little OPP(1766400)->power = 351114 uW
big OPP(1056000)->power = 195991 uW
ration = 1.79
[1] results gives
little OPP(1766400)->power = 193.281 mW
big OPP(1056000)->power = 216.405 mW
ratio = 0.89
The ratios are a bit different and give a
correct_little_dynamic-power-coefficient = 144 which is different
than when using ->cost. This probably comes from rounding and which
figures have been used to compute the model.
If you have Voltage of OPP, the formula used in energy model is power
(uW) = dynamic-power-coefficient * uV^2 * Freq (Mhz) so you can
compute dynamic-power-coefficient for each OPPs. They should be close
and then you will have to decide which one is the "best"
I don't have access to sdm8150 or sdm8250 boards but you can use the
same process to check that the energy model is aligned with the
figures in [1]
[1] https://github.com/kdrag0n/freqbench/tree/master/results
Regards,
Vincent
>
> Regards,
> Bjorn
>
> > [1] https://github.com/kdrag0n/freqbench/tree/master/results/sdm845/main
> >
> > Fixes: 0e0a8e35d725 ("arm64: dts: qcom: sdm845: correct dynamic power coefficients")
> > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > ---
> > arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > index 65032b94b46d..869bdb9bce6e 100644
> > --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > @@ -198,7 +198,7 @@ CPU0: cpu@0 {
> > reg = <0x0 0x0>;
> > enable-method = "psci";
> > capacity-dmips-mhz = <611>;
> > - dynamic-power-coefficient = <290>;
> > + dynamic-power-coefficient = <154>;
> > qcom,freq-domain = <&cpufreq_hw 0>;
> > operating-points-v2 = <&cpu0_opp_table>;
> > interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> > @@ -222,7 +222,7 @@ CPU1: cpu@100 {
> > reg = <0x0 0x100>;
> > enable-method = "psci";
> > capacity-dmips-mhz = <611>;
> > - dynamic-power-coefficient = <290>;
> > + dynamic-power-coefficient = <154>;
> > qcom,freq-domain = <&cpufreq_hw 0>;
> > operating-points-v2 = <&cpu0_opp_table>;
> > interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> > @@ -243,7 +243,7 @@ CPU2: cpu@200 {
> > reg = <0x0 0x200>;
> > enable-method = "psci";
> > capacity-dmips-mhz = <611>;
> > - dynamic-power-coefficient = <290>;
> > + dynamic-power-coefficient = <154>;
> > qcom,freq-domain = <&cpufreq_hw 0>;
> > operating-points-v2 = <&cpu0_opp_table>;
> > interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> > @@ -264,7 +264,7 @@ CPU3: cpu@300 {
> > reg = <0x0 0x300>;
> > enable-method = "psci";
> > capacity-dmips-mhz = <611>;
> > - dynamic-power-coefficient = <290>;
> > + dynamic-power-coefficient = <154>;
> > qcom,freq-domain = <&cpufreq_hw 0>;
> > operating-points-v2 = <&cpu0_opp_table>;
> > interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> > --
> > 2.34.1
> >
[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 723 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] arm64: dts: qcom: sdm845: correct dynamic power coefficients
2023-01-09 17:02 ` Vincent Guittot
@ 2023-01-18 23:26 ` Bjorn Andersson
2023-02-27 9:11 ` Vincent Guittot
0 siblings, 1 reply; 9+ messages in thread
From: Bjorn Andersson @ 2023-01-18 23:26 UTC (permalink / raw)
To: Vincent Guittot, dmitry.baryshkov
Cc: agross, konrad.dybcio, robh+dt, krzysztof.kozlowski+dt,
linux-arm-msm, devicetree, danny
On Mon, Jan 09, 2023 at 06:02:29PM +0100, Vincent Guittot wrote:
> On Fri, 6 Jan 2023 at 19:28, Bjorn Andersson <andersson@kernel.org> wrote:
> >
> > On Fri, Jan 06, 2023 at 05:46:18PM +0100, Vincent Guittot wrote:
> >
> > Seems like using get_maintainer.pl would have saved you some trouble ;)
>
> The worst is that I used it but only checked names and not emails
> when I reused the list of the original patch :-(
>
:)
> >
> > > While stressing EAS on my dragonboard RB3, I have noticed that LITTLE cores
> > > where never selected as the most energy efficient CPU whatever the
> > > utilization level of waking task.
> > >
> > > energy model framework uses its cost field to estimate the energy with
> > > the formula:
> > >
> > > nrg = cost of the selected OPP * utilization / CPU's max capacity
> > >
> > > which ends up selecting the CPU with lowest cost / max capacity ration
> > > as long as the utilization fits in the OPP's capacity.
> > >
> > > If we compare the cost of a little OPP with similar capacity of a big OPP
> > > like :
> > > OPP(kHz) OPP capacity cost max capacity cost/max capacity
> > > LITTLE 1766400 407 351114 407 863
> > > big 1056000 408 520267 1024 508
> > >
> > > This can be interpreted as the LITTLE core consumes 70% more than big core
> > > for the same compute capacity.
> > >
> > > According to [1], LITTLE consumes 10% less than big core for Coremark
> > > benchmark at those OPPs. If we consider that everything else stays
> > > unchanged, the dynamic-power-coefficient of LITTLE core should be
> > > only 53% of the current value: 290 * 53% = 154
> > >
> > > Set the dynamic-power-coefficient of CPU0-3 to 154 to fix the energy model.
> > >
> >
> > This is sounds reasonable.
> >
Dmitry, what do you think about this?
> > But if the math was wrong for SDM845, I would assume that sm8150 and
> > sm8250 are wrong as well, as that's what 0e0a8e35d725 is based on. And
> > should I assume that patches for other platforms are off by 53% as well?
>
> I don't think that we can assume that there is an error and in
> particular the same 53% error for others.
>
> >
> > Can you help me understand how to arrive at this number? (Without
> > considering everything else stays unchanged, if needed).
>
> In order to do the full computation, we need the voltage of each OPP
> which I don't have as they are provided by the LUT at boot IIUC.
> Instead I have used the debugfs output of the energy model and
> compared the value of (perf_state->cost/cpu_max_capacity) with the
> energy and duration figures available in [1].
>
> In the case of SDM845, it was pretty easy to compare the OPPs of big
> and LITTLE because the duration and the perf result were the same for
> 2 OPPS so we should have :
>
> (little OPP(1766400)->cost / little max capacity (407)) / (big
> OPP(1056000)->cost / big max capacity(1024)) = little OPP(1766400)
> energy / big OPP(1056000) energy
>
> (little OPP(1766400)->cost / little max capacity (407)) / (big
> OPP(1056000)->cost / big max capacity(1024)) = 0.90
>
> but current output gives:
>
> (little OPP(1766400)->cost / little max capacity (407)) / (big
> OPP(1056000)->cost / big max capacity(1024)) = 1.70
>
> As we consider everything else constant, it can be simplified by:
>
> correct_little_dynamic-power-coefficient * const_A = 0.90
>
> Whereas we currently have
>
> current_little_dynamic-power-coefficient * const_A = 1.70
>
> and we ends up with
>
> correct_little_dynamic-power-coefficient = 0.90 / 1.70 *
> current_little_dynamic-power-coefficient = 154
>
> That being said, it can be simpler as the energy model provide the power figures
>
> little OPP(1766400)->power = 351114 uW
> big OPP(1056000)->power = 195991 uW
> ration = 1.79
>
> [1] results gives
> little OPP(1766400)->power = 193.281 mW
> big OPP(1056000)->power = 216.405 mW
> ratio = 0.89
>
> The ratios are a bit different and give a
> correct_little_dynamic-power-coefficient = 144 which is different
> than when using ->cost. This probably comes from rounding and which
> figures have been used to compute the model.
>
> If you have Voltage of OPP, the formula used in energy model is power
> (uW) = dynamic-power-coefficient * uV^2 * Freq (Mhz) so you can
> compute dynamic-power-coefficient for each OPPs. They should be close
> and then you will have to decide which one is the "best"
>
> I don't have access to sdm8150 or sdm8250 boards but you can use the
> same process to check that the energy model is aligned with the
> figures in [1]
>
> [1] https://github.com/kdrag0n/freqbench/tree/master/results
>
> Regards,
> Vincent
Thanks for the explanation Vincent!
Regards,
Bjorn
> >
> > Regards,
> > Bjorn
> >
> > > [1] https://github.com/kdrag0n/freqbench/tree/master/results/sdm845/main
> > >
> > > Fixes: 0e0a8e35d725 ("arm64: dts: qcom: sdm845: correct dynamic power coefficients")
> > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > > ---
> > > arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 ++++----
> > > 1 file changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > > index 65032b94b46d..869bdb9bce6e 100644
> > > --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> > > @@ -198,7 +198,7 @@ CPU0: cpu@0 {
> > > reg = <0x0 0x0>;
> > > enable-method = "psci";
> > > capacity-dmips-mhz = <611>;
> > > - dynamic-power-coefficient = <290>;
> > > + dynamic-power-coefficient = <154>;
> > > qcom,freq-domain = <&cpufreq_hw 0>;
> > > operating-points-v2 = <&cpu0_opp_table>;
> > > interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> > > @@ -222,7 +222,7 @@ CPU1: cpu@100 {
> > > reg = <0x0 0x100>;
> > > enable-method = "psci";
> > > capacity-dmips-mhz = <611>;
> > > - dynamic-power-coefficient = <290>;
> > > + dynamic-power-coefficient = <154>;
> > > qcom,freq-domain = <&cpufreq_hw 0>;
> > > operating-points-v2 = <&cpu0_opp_table>;
> > > interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> > > @@ -243,7 +243,7 @@ CPU2: cpu@200 {
> > > reg = <0x0 0x200>;
> > > enable-method = "psci";
> > > capacity-dmips-mhz = <611>;
> > > - dynamic-power-coefficient = <290>;
> > > + dynamic-power-coefficient = <154>;
> > > qcom,freq-domain = <&cpufreq_hw 0>;
> > > operating-points-v2 = <&cpu0_opp_table>;
> > > interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> > > @@ -264,7 +264,7 @@ CPU3: cpu@300 {
> > > reg = <0x0 0x300>;
> > > enable-method = "psci";
> > > capacity-dmips-mhz = <611>;
> > > - dynamic-power-coefficient = <290>;
> > > + dynamic-power-coefficient = <154>;
> > > qcom,freq-domain = <&cpufreq_hw 0>;
> > > operating-points-v2 = <&cpu0_opp_table>;
> > > interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
> > > --
> > > 2.34.1
> > >
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] arm64: dts: qcom: sdm845: correct dynamic power coefficients
2023-01-18 23:26 ` Bjorn Andersson
@ 2023-02-27 9:11 ` Vincent Guittot
0 siblings, 0 replies; 9+ messages in thread
From: Vincent Guittot @ 2023-02-27 9:11 UTC (permalink / raw)
To: Bjorn Andersson
Cc: dmitry.baryshkov, agross, konrad.dybcio, robh+dt,
krzysztof.kozlowski+dt, linux-arm-msm, devicetree, danny
Hi Bjorn,
On Thu, 19 Jan 2023 at 00:26, Bjorn Andersson <andersson@kernel.org> wrote:
>
[...]
> > > > According to [1], LITTLE consumes 10% less than big core for Coremark
> > > > benchmark at those OPPs. If we consider that everything else stays
> > > > unchanged, the dynamic-power-coefficient of LITTLE core should be
> > > > only 53% of the current value: 290 * 53% = 154
> > > >
> > > > Set the dynamic-power-coefficient of CPU0-3 to 154 to fix the energy model.
> > > >
> > >
> > > This is sounds reasonable.
> > >
>
> Dmitry, what do you think about this?
What is the status for this patch ?
The problem is still present AFAICT
Regards,
Vincent
>
[...]
> > > >
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] arm64: dts: qcom: sdm845: correct dynamic power coefficients
2023-01-06 16:46 Vincent Guittot
2023-01-06 18:28 ` Bjorn Andersson
@ 2023-03-16 3:21 ` Bjorn Andersson
1 sibling, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2023-03-16 3:21 UTC (permalink / raw)
To: robh+dt, Vincent Guittot, konrad.dybcio, linux-arm-msm,
devicetree, agross, dmitry.baryshkov, krzysztof.kozlowski+dt
Cc: danny
On Fri, 6 Jan 2023 17:46:18 +0100, Vincent Guittot wrote:
> While stressing EAS on my dragonboard RB3, I have noticed that LITTLE cores
> where never selected as the most energy efficient CPU whatever the
> utilization level of waking task.
>
> energy model framework uses its cost field to estimate the energy with
> the formula:
>
> [...]
Applied, thanks!
[1/1] arm64: dts: qcom: sdm845: correct dynamic power coefficients
commit: 44750f153699b6e4f851a399287e5c8df208d696
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-03-16 3:19 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-06 16:45 [PATCH] arm64: dts: qcom: sdm845: correct dynamic power coefficients Vincent Guittot
-- strict thread matches above, loose matches on Subject: below --
2023-01-06 16:46 Vincent Guittot
2023-01-06 18:28 ` Bjorn Andersson
2023-01-09 17:02 ` Vincent Guittot
2023-01-18 23:26 ` Bjorn Andersson
2023-02-27 9:11 ` Vincent Guittot
2023-03-16 3:21 ` Bjorn Andersson
2023-01-06 16:43 Vincent Guittot
2022-03-15 14:11 Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).