diff options
author | Julien Thierry <julien.thierry@arm.com> | 2017-10-13 14:32:56 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2017-10-13 18:56:15 +0100 |
commit | 7b77452ec524fa845efdec28ae16e2202cf797dc (patch) | |
tree | fa5da4cbe17b85d94be06f1e704eff52fe88f1f9 /include/clocksource | |
parent | ec5c8e429d07737ee94ee1fd2ae5029547484194 (diff) | |
download | linux-7b77452ec524fa845efdec28ae16e2202cf797dc.tar.gz linux-7b77452ec524fa845efdec28ae16e2202cf797dc.tar.bz2 linux-7b77452ec524fa845efdec28ae16e2202cf797dc.zip |
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>
Diffstat (limited to 'include/clocksource')
-rw-r--r-- | include/clocksource/arm_arch_timer.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h index 4e28283e2ec6..349e5957c949 100644 --- a/include/clocksource/arm_arch_timer.h +++ b/include/clocksource/arm_arch_timer.h @@ -67,7 +67,9 @@ enum arch_timer_spi_nr { #define ARCH_TIMER_USR_VT_ACCESS_EN (1 << 8) /* virtual timer registers */ #define ARCH_TIMER_USR_PT_ACCESS_EN (1 << 9) /* physical timer registers */ -#define ARCH_TIMER_EVT_STREAM_FREQ 10000 /* 100us */ +#define ARCH_TIMER_EVT_STREAM_PERIOD_US 100 +#define ARCH_TIMER_EVT_STREAM_FREQ \ + (USEC_PER_SEC / ARCH_TIMER_EVT_STREAM_PERIOD_US) struct arch_timer_kvm_info { struct timecounter timecounter; |