add chaos_calmer branch
[15.05/openwrt.git] / target / linux / mvebu / patches-3.18 / 061-cpuidle-mvebu-Update-cpuidle-thresholds-for-Armada-X.patch
1 From ce6031c89a35cffd5a5992b08377b77f49a004b9 Mon Sep 17 00:00:00 2001
2 From: Sebastien Rannou <mxs@sbrk.org>
3 Date: Fri, 13 Feb 2015 15:55:03 +0100
4 Subject: [PATCH] cpuidle: mvebu: Update cpuidle thresholds for Armada XP SOCs
5
6 Originally, the thresholds used in the cpuidle driver for Armada SOCs
7 were temporarily chosen, leaving room for improvements.
8
9 This commit updates the thresholds for the Armada XP SOCs with values
10 that positively impact performances:
11
12                                 without patch  with patch   vendor kernel
13  - iperf localhost (gbit/sec)   ~3.7           ~6.4         ~5.4
14  - ioping tmpfs (iops)          ~163k          ~206k        ~179k
15  - ioping tmpfs (mib/s)         ~636           ~805         ~699
16
17 The idle power consumption is negatively impacted (proportionally less
18 than the performance gain), and we are still performing better than
19 the vendor kernel here:
20
21                                 without patch   with patch  vendor kernel
22  - power consumption idle (W)   ~2.4            ~3.2        ~4.4
23  - power consumption busy (W)   ~8.6            ~8.3        ~8.6
24
25 There is still room for improvement regarding the value of these
26 thresholds, they were chosen to mimic the vendor kernel.
27
28 This patch only impacts Armada XP SOCs and was tested on Online Labs
29 C1 boards. A similar approach can be taken to improve the performances
30 of the Armada 370 and Armada 38x SOCs.
31
32 Thanks a lot to Thomas Petazzoni, Gregory Clement and Willy Tarreau
33 for the discussions and tips around this topic.
34
35 Signed-off-by: Sebastien Rannou <mxs@sbrk.org>
36 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
37 Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
38 ---
39  drivers/cpuidle/cpuidle-mvebu-v7.c | 8 ++++----
40  1 file changed, 4 insertions(+), 4 deletions(-)
41
42 --- a/drivers/cpuidle/cpuidle-mvebu-v7.c
43 +++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
44 @@ -50,18 +50,18 @@ static struct cpuidle_driver armadaxp_id
45         .states[0]              = ARM_CPUIDLE_WFI_STATE,
46         .states[1]              = {
47                 .enter                  = mvebu_v7_enter_idle,
48 -               .exit_latency           = 10,
49 +               .exit_latency           = 100,
50                 .power_usage            = 50,
51 -               .target_residency       = 100,
52 +               .target_residency       = 1000,
53                 .flags                  = CPUIDLE_FLAG_TIME_VALID,
54                 .name                   = "MV CPU IDLE",
55                 .desc                   = "CPU power down",
56         },
57         .states[2]              = {
58                 .enter                  = mvebu_v7_enter_idle,
59 -               .exit_latency           = 100,
60 +               .exit_latency           = 1000,
61                 .power_usage            = 5,
62 -               .target_residency       = 1000,
63 +               .target_residency       = 10000,
64                 .flags                  = CPUIDLE_FLAG_TIME_VALID |
65                                                 MVEBU_V7_FLAG_DEEP_IDLE,
66                 .name                   = "MV CPU DEEP IDLE",