diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2013-07-18 16:21:17 -0700 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2013-07-30 11:24:21 -0700 |
commit | e7e3ff1bfe9c42ee31172e9afdc0383a9e595e29 (patch) | |
tree | 3d3adc5cb561e0923947b7b200c29ddc79e050f5 /include/linux | |
parent | a08ca5d1089da03724f96fa0870c64968e66765b (diff) | |
download | linux-stable-e7e3ff1bfe9c42ee31172e9afdc0383a9e595e29.tar.gz linux-stable-e7e3ff1bfe9c42ee31172e9afdc0383a9e595e29.tar.bz2 linux-stable-e7e3ff1bfe9c42ee31172e9afdc0383a9e595e29.zip |
sched_clock: Add support for >32 bit sched_clock
The ARM architected system counter has at least 56 usable bits.
Add support for counters with more than 32 bits to the generic
sched_clock implementation so we can increase the time between
wakeups due to dealing with wrap-around on these devices while
benefiting from the irqtime accounting and suspend/resume
handling that the generic sched_clock code already has. On my
system using 56 bits over 32 bits changes the wraparound time
from a few minutes to an hour. For faster running counters (GHz
range) this is even more important because we may not be able to
execute the timer in time to deal with the wraparound if only 32
bits are used.
We choose a maxsec value of 3600 seconds because we assume no
system will go idle for more than an hour. In the future we may
need to increase this value.
Note: All users should switch over to the 64-bit read function so
we can remove setup_sched_clock() in favor of sched_clock_register().
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sched_clock.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/sched_clock.h b/include/linux/sched_clock.h index fa7922c80a41..eca7abeb86fc 100644 --- a/include/linux/sched_clock.h +++ b/include/linux/sched_clock.h @@ -15,6 +15,8 @@ static inline void sched_clock_postinit(void) { } #endif extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); +extern void sched_clock_register(u64 (*read)(void), int bits, + unsigned long rate); extern unsigned long long (*sched_clock_func)(void); |