mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Christian Hewitt <christianshewitt@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Kevin Hilman <khilman@baylibre.com>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: dts: meson: Add capacity-dmips-mhz attributes to GXM
Date: Tue, 24 Nov 2020 14:24:13 +0100	[thread overview]
Message-ID: <c5656549-6c99-95b5-0cdb-a9f1a5d538e0@baylibre.com> (raw)
In-Reply-To: <20201124121740.25704-1-christianshewitt@gmail.com>

On 24/11/2020 13:17, Christian Hewitt wrote:
> GXM (S912) is a big-little design with CPUs 0-3 clocked at 1.5GHz
> and CPUs 4-7 at 1.0GHz. Adding capacity-dmips-mhz attributes allows
> the scheduler to factor the different clock speeds into capacity
> calculations and prefer the higher-clocked cluster to improve
> overall performance.
> 
> This was inspired by the similar change for G12B [0] boards. The
> diference here is that all cores are A53's so the same dmips-mhz
> value is used.
> 
> VIM2:~ # cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
> 1512000
> 1512000
> 1512000
> 1512000
> 1000000
> 1000000
> 1000000
> 1000000
> 
> before:
> 
> VIM2:~ # cat /sys/devices/system/cpu/cpu*/cpu_capacity
> 1024
> 1024
> 1024
> 1024
> 1024
> 1024
> 1024
> 1024
> 
> after:
> 
> VIM2:~ # cat /sys/devices/system/cpu/cpu*/cpu_capacity
> 1024
> 1024
> 1024
> 1024
> 677
> 677
> 677
> 677
> 
> The after value matches my table-napkin calculation:
> 
> (1000000 / 1512000 = 0.661) * 1024 = 677
> 
> [0] https://github.com/torvalds/linux/commit/6eeaf4d2452ec8b1ece58776812140734fc2e088
> 
> Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
> ---
>  arch/arm64/boot/dts/amlogic/meson-gxm.dtsi | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi
> index fe4145112295..411cc312fc62 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxm.dtsi
> @@ -42,11 +42,28 @@
>  			};
>  		};
>  
> +		cpu0: cpu@0 {
> +			capacity-dmips-mhz = <1024>;
> +		};
> +
> +		cpu1: cpu@1 {
> +			capacity-dmips-mhz = <1024>;
> +		};
> +
> +		cpu2: cpu@2 {
> +			capacity-dmips-mhz = <1024>;
> +		};
> +
> +		cpu3: cpu@3 {
> +			capacity-dmips-mhz = <1024>;
> +		};
> +
>  		cpu4: cpu@100 {
>  			device_type = "cpu";
>  			compatible = "arm,cortex-a53";
>  			reg = <0x0 0x100>;
>  			enable-method = "psci";
> +			capacity-dmips-mhz = <1024>;
>  			next-level-cache = <&l2>;
>  			clocks = <&scpi_dvfs 1>;
>  			#cooling-cells = <2>;
> @@ -57,6 +74,7 @@
>  			compatible = "arm,cortex-a53";
>  			reg = <0x0 0x101>;
>  			enable-method = "psci";
> +			capacity-dmips-mhz = <1024>;
>  			next-level-cache = <&l2>;
>  			clocks = <&scpi_dvfs 1>;
>  			#cooling-cells = <2>;
> @@ -67,6 +85,7 @@
>  			compatible = "arm,cortex-a53";
>  			reg = <0x0 0x102>;
>  			enable-method = "psci";
> +			capacity-dmips-mhz = <1024>;
>  			next-level-cache = <&l2>;
>  			clocks = <&scpi_dvfs 1>;
>  			#cooling-cells = <2>;
> @@ -77,6 +96,7 @@
>  			compatible = "arm,cortex-a53";
>  			reg = <0x0 0x103>;
>  			enable-method = "psci";
> +			capacity-dmips-mhz = <1024>;
>  			next-level-cache = <&l2>;
>  			clocks = <&scpi_dvfs 1>;
>  			#cooling-cells = <2>;
> 

Re-reading the bindings, the value is correct and necessary to have the cpu_capacity calculated
to help the scheduler.

Thanks!

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

      reply	other threads:[~2020-11-24 13:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 12:17 Christian Hewitt
2020-11-24 13:24 ` Neil Armstrong [this message]

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=c5656549-6c99-95b5-0cdb-a9f1a5d538e0@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=christianshewitt@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

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

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

all inboxes | Powered by JetHome®