]> git.karo-electronics.de Git - karo-tx-linux.git/commit
sched_clock: Add support for >32 bit sched_clock
authorStephen Boyd <sboyd@codeaurora.org>
Thu, 18 Jul 2013 23:21:17 +0000 (16:21 -0700)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 30 Jul 2013 18:24:21 +0000 (11:24 -0700)
commite7e3ff1bfe9c42ee31172e9afdc0383a9e595e29
tree3d3adc5cb561e0923947b7b200c29ddc79e050f5
parenta08ca5d1089da03724f96fa0870c64968e66765b
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>
include/linux/sched_clock.h
kernel/time/sched_clock.c