]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: use WFE for long delays
authorJulien Thierry <julien.thierry@arm.com>
Fri, 13 Oct 2017 13:32:56 +0000 (14:32 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 13 Oct 2017 17:56:15 +0000 (18:56 +0100)
commit61757c2c5583d2f0d4b3fe86882efb62da9db9e2
treefa5da4cbe17b85d94be06f1e704eff52fe88f1f9
parent96b8bfcef7033c64570e1e2cb92ca3c8c361fa19
arm64: use WFE for long delays

The current delay implementation uses the yield instruction, which is a
hint that it is beneficial to schedule another thread. As this is a hint,
it may be implemented as a NOP, causing all delays to be busy loops. This
is the case for many existing CPUs.

Taking advantage of the generic timer sending periodic events to all
cores, we can use WFE during delays to reduce power consumption. This is
beneficial only for delays longer than the period of the timer event
stream.

If timer event stream is not enabled, delays will behave as yield/busy
loops.

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/lib/delay.c
include/clocksource/arm_arch_timer.h