From patchwork Fri Jul 6 06:57:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 141258 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2774722ljj; Thu, 5 Jul 2018 23:57:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeMyQQmlmw1XMmc7euRxjmcEdBBRZu+b5VSt4QHCJ+W3zMIT8rnDTXuePaE1CfcGLndQatl X-Received: by 2002:a63:7454:: with SMTP id e20-v6mr3777925pgn.410.1530860253238; Thu, 05 Jul 2018 23:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530860253; cv=none; d=google.com; s=arc-20160816; b=jxb/0UjKR9ibE9Dyd2dvOit2RT3lrvU0lh7kL4mNapAuoJlavVzM/u7K3gZq2H0IMr /FdPFGSgdLpfTe2XYxBOXqQtNUnbmPeiJPMFRtB7hG08hZGJOqkFiJIiEVS3GT8F4iJo fLZmoPVWZbeflA9dM4GYC5Lzyf4biBLYLZLqAkDMKOc04YPzXBLT9AZRoFjwdfi849Wi nIUcxFje9dcGgSsTS/vTQu6tcpx/etmytRb++fOzCCMyTbZiIBXy1YHvOG4nxvuix7Fn T566GmE9Fk93wBnv/LcHVlB5Mt8K3G25uetW/5Iuq7JHrEMRz2F/PaYSs10D9Ys0CIH5 2GnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=lJnQh0qtme7wkQhl9Vcimo6VNgw5oJxKCzRpv+WsVKE=; b=UOcEblHOfnXhEdMp5mWzxVebRHaFSTfFCcIvs2YHM/crJ2hq33lKCW+tyCjkA07c8F naJz+WaE8d9X84SNjGdt5AHpfhwYorvct9WPjQGLDhnHUlkJ81WIfEnYdR1TenmSZS2b pIeHY+3Nkyi/uDTGXNSvj9oPTjYS6tgRX/yd2O+lz5KazOzAu/Mx2WNLvBtpkdbDpNIz INnh5WfqLSD0noLZCft4l+G/37R+8db+K8v9qE2tjlM4Jv5YAPdesJ/6h4Ul+l6WREb/ Dc3CP8zfUePSB+EtW2n6WAQQxXFWJR6VOifSVJtlMm879TWo3ptnyGU7y7jyZaiQ9G4x P//A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SOBajPh9; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9-v6si7646502plt.232.2018.07.05.23.57.33; Thu, 05 Jul 2018 23:57:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SOBajPh9; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753225AbeGFG5c (ORCPT + 5 others); Fri, 6 Jul 2018 02:57:32 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:54191 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753007AbeGFG5b (ORCPT ); Fri, 6 Jul 2018 02:57:31 -0400 Received: by mail-wm0-f68.google.com with SMTP id b188-v6so13785782wme.3 for ; Thu, 05 Jul 2018 23:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=GnW9KL3F3VgyX6Arpx94FfMZtNa5kkrbUdJqLVmrorg=; b=SOBajPh9DpisEvF6b2H2LEOJgGRfLXdGy32dgFYcGlg3RsCFfCvVLR2xAZ8vrG9FZP zD3pqFwDZy67rpZ7gT0hoWqxc1BkzTrO//+m285j+Z28y31QKfXWPtjvZNhVZOlq4NTZ meIppILQLWCmk4dFB47QqtZe68Bkq9zhPl8t0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GnW9KL3F3VgyX6Arpx94FfMZtNa5kkrbUdJqLVmrorg=; b=mxWfaiJe/dr7GySTJX/ZiCfWtSrj8Kf1Lu7oQFH9QLLOAXDSKAJCKEUEAjI7wgw0sj EQEp/Z/NPZQKgmE+0j/9pdzwd7iHrfJJBUpVXXILSutnkAzW9+kqwIxbcTI+v19jyNle LXmhNv9P9k7QDoUx9vwjXE97SdD0ot3/5CjRF+J8DGxD2+O6eEImmB+0iDSsyYxtkhJi rbjbbiGioPTdizLAEvdXLhBQ2QHvliw9ENCTvrmQGonCu9XAKf6vkAP3HFHuyrhQCAPl gHVbbEND3ugEm33EHTO3VmOM4165Ip11YZmFYQHaGFl/Jn56e8l215KRHSueSvSXtsU/ i7Iw== X-Gm-Message-State: APt69E3ajAXDrif1lyMTrIJnK1qQ4X7/Jq8/65isMBq9bkwB1s5g7Edr McrEw8mpMgtOA0Oy2jlQTY+Mjw== X-Received: by 2002:a1c:b8d2:: with SMTP id i201-v6mr5272283wmf.158.1530860250023; Thu, 05 Jul 2018 23:57:30 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:a41c:a3ee:84e4:bb78]) by smtp.gmail.com with ESMTPSA id g4-v6sm6183432wrq.32.2018.07.05.23.57.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jul 2018 23:57:29 -0700 (PDT) From: Vincent Guittot To: xuwei5@hisilicon.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: leo.yan@linaro.org, daniel.lezcano@linaro.org, Vincent Guittot Subject: [PATCH] arm64: hikey960: update idle-states Date: Fri, 6 Jul 2018 08:57:26 +0200 Message-Id: <1530860246-29072-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Update entry/exit latency and residency time of hikey960 to use more realistic figures based on unitary tests done on the platform. The complete results (in us) : big cluster cluster CPU max entry latency 800 400 max exit latency 2900 550 residency 903Mhz 5000 1500 residency 2363Mhz 0 1500 little cluster cluster CPU max entry latency 500 400 max exit latency 1600 650 residency 533Mhz 8000 4500 residency 1844Mhz 0 1500 We can see that the residency time depends of the running OPP which is not handled for now. Then we also have to take into account the constraint of a residency time shorter than the tick to get full advantage of idle loop reordering(tick is stopped if idle duration is higher than tick period). Finally the selected residency value are : big cluster cluster CPU residency 3700 1500 little cluster cluster CPU residency 3500 1500 A simple test with a task waking up every 11,111ms shows improvement: - 5% a lowest OPP - 22% at highest OPP The period has been chosen: - to be shorter than old cluster residency time and longer than new residency time od cluster off C-state - to prevent any sync with tick (4ms) when running tests that can add some variances between tests Signed-off-by: Vincent Guittot --- arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 45 ++++++++++++++++++------------- 1 file changed, 27 insertions(+), 18 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Daniel Lezcano diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi index 421d454..890d23e 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi +++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi @@ -61,7 +61,7 @@ reg = <0x0 0x0>; enable-method = "psci"; next-level-cache = <&A53_L2>; - cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; + cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>; capacity-dmips-mhz = <592>; clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>; operating-points-v2 = <&cluster0_opp>; @@ -75,7 +75,7 @@ reg = <0x0 0x1>; enable-method = "psci"; next-level-cache = <&A53_L2>; - cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; + cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>; capacity-dmips-mhz = <592>; clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>; operating-points-v2 = <&cluster0_opp>; @@ -87,7 +87,7 @@ reg = <0x0 0x2>; enable-method = "psci"; next-level-cache = <&A53_L2>; - cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; + cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>; capacity-dmips-mhz = <592>; clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>; operating-points-v2 = <&cluster0_opp>; @@ -99,7 +99,7 @@ reg = <0x0 0x3>; enable-method = "psci"; next-level-cache = <&A53_L2>; - cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; + cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>; capacity-dmips-mhz = <592>; clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER0>; operating-points-v2 = <&cluster0_opp>; @@ -111,7 +111,7 @@ reg = <0x0 0x100>; enable-method = "psci"; next-level-cache = <&A73_L2>; - cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>; + cpu-idle-states = <&CPU_SLEEP_1 &CLUSTER_SLEEP_1>; capacity-dmips-mhz = <1024>; clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>; operating-points-v2 = <&cluster1_opp>; @@ -125,7 +125,7 @@ reg = <0x0 0x101>; enable-method = "psci"; next-level-cache = <&A73_L2>; - cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>; + cpu-idle-states = <&CPU_SLEEP_1 &CLUSTER_SLEEP_1>; capacity-dmips-mhz = <1024>; clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>; operating-points-v2 = <&cluster1_opp>; @@ -137,7 +137,7 @@ reg = <0x0 0x102>; enable-method = "psci"; next-level-cache = <&A73_L2>; - cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>; + cpu-idle-states = <&CPU_SLEEP_1 &CLUSTER_SLEEP_1>; capacity-dmips-mhz = <1024>; clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>; operating-points-v2 = <&cluster1_opp>; @@ -149,7 +149,7 @@ reg = <0x0 0x103>; enable-method = "psci"; next-level-cache = <&A73_L2>; - cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_1>; + cpu-idle-states = <&CPU_SLEEP_1 &CLUSTER_SLEEP_1>; capacity-dmips-mhz = <1024>; clocks = <&stub_clock HI3660_CLK_STUB_CLUSTER1>; operating-points-v2 = <&cluster1_opp>; @@ -158,31 +158,40 @@ idle-states { entry-method = "psci"; - CPU_SLEEP: cpu-sleep { + CPU_SLEEP_0: cpu-sleep-0 { compatible = "arm,idle-state"; local-timer-stop; arm,psci-suspend-param = <0x0010000>; - entry-latency-us = <40>; - exit-latency-us = <70>; - min-residency-us = <3000>; + entry-latency-us = <400>; + exit-latency-us = <650>; + min-residency-us = <1500>; }; - CLUSTER_SLEEP_0: cluster-sleep-0 { compatible = "arm,idle-state"; local-timer-stop; arm,psci-suspend-param = <0x1010000>; entry-latency-us = <500>; - exit-latency-us = <5000>; - min-residency-us = <20000>; + exit-latency-us = <1600>; + min-residency-us = <3500>; + }; + + + CPU_SLEEP_1: cpu-sleep-1 { + compatible = "arm,idle-state"; + local-timer-stop; + arm,psci-suspend-param = <0x0010000>; + entry-latency-us = <400>; + exit-latency-us = <550>; + min-residency-us = <1500>; }; CLUSTER_SLEEP_1: cluster-sleep-1 { compatible = "arm,idle-state"; local-timer-stop; arm,psci-suspend-param = <0x1010000>; - entry-latency-us = <1000>; - exit-latency-us = <5000>; - min-residency-us = <20000>; + entry-latency-us = <800>; + exit-latency-us = <2900>; + min-residency-us = <3500>; }; };