Jisheng Zhang b5fda7ed5c arm64: cpuidle: make arm_cpuidle_suspend() a bit more efficient
Currently, we check two pointers: cpu_ops and cpu_suspend on every idle
state entry. These pointers check can be avoided:

If cpu_ops has not been registered, arm_cpuidle_init() will return
-EOPNOTSUPP, so arm_cpuidle_suspend() will never have chance to
run. In other word, the cpu_ops check can be avoid.

Similarly, the cpu_suspend check could be avoided in this hot path by
moving it into arm_cpuidle_init().

I measured the 4096 * time from arm_cpuidle_suspend entry point to the
cpu_psci_cpu_suspend entry point. HW platform is Marvell BG4CT STB
board.

1. only one shell, no other process, hot-unplug secondary cpus, execute
the following cmd

while true
do
	sleep 0.2
done

before the patch: 1581220ns

after the patch: 1579630ns

reduced by 0.1%

2. only one shell, no other process, hot-unplug secondary cpus, execute
the following cmd

while true
do
	md5sum /tmp/testfile
	sleep 0.2
done

NOTE: the testfile size should be larger than L1+L2 cache size

before the patch: 1961960ns
after the patch: 1912500ns

reduced by 2.5%

So the more complex the system load, the bigger the improvement.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2016-04-13 14:49:23 +01:00
..
2012-09-17 13:42:21 +01:00
2016-03-17 20:03:47 -07:00
2016-03-17 20:03:47 -07:00
2016-03-04 18:19:17 +00:00
2016-03-24 19:13:59 -07:00
2016-03-17 20:03:47 -07:00
2016-01-17 19:15:26 -05:00
2016-03-04 18:19:17 +00:00
2016-02-24 14:57:27 +00:00
2016-02-24 14:57:27 +00:00
2016-02-24 14:57:24 +00:00
2016-03-02 15:49:28 +00:00
2016-03-17 20:03:47 -07:00
2016-03-02 15:49:28 +00:00
2016-03-09 15:43:42 -08:00
2016-03-17 20:03:47 -07:00
2016-02-16 15:10:44 +00:00
2015-01-27 09:38:08 +00:00
2016-02-12 15:53:51 +00:00