diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-11 11:44:02 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-11 11:44:02 -0500 |
commit | edc4d272551594729f63ca4cde1612608494091f (patch) | |
tree | e823892f052e72e1fa6ee07eae986993965cc3e8 /arch/arm | |
parent | 211baa7016894c02fc18693e21ca479cd08ac0c0 (diff) |
ARM: sched_clock: make minsec argument to clocks_calc_mult_shift() zero
The purpose of the minsec argument is to prevent 64-bit math overflow
when the number of cycles is multiplied up. However, the multipler
is 32-bit, and in the sched_clock() case, the cycle counter is up to
32-bit as well. So the math can never overflow.
With a value of 60, and clock rates greater than 71MHz, the calculated
multiplier is unnecessarily reduced in value, which reduces accuracy by
maybe 70ppt. It's almost not worth bothering with as the oscillator
driving the counter won't be any more than 1ppm - unless you're using
a rubidium lamp or caesium fountain frequency standard.
So, set the minsec argument to zero.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/sched_clock.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c index 784464a21c1c..9a46370fe9da 100644 --- a/arch/arm/kernel/sched_clock.c +++ b/arch/arm/kernel/sched_clock.c | |||
@@ -34,7 +34,7 @@ void __init init_sched_clock(struct clock_data *cd, void (*update)(void), | |||
34 | sched_clock_update_fn = update; | 34 | sched_clock_update_fn = update; |
35 | 35 | ||
36 | /* calculate the mult/shift to convert counter ticks to ns. */ | 36 | /* calculate the mult/shift to convert counter ticks to ns. */ |
37 | clocks_calc_mult_shift(&cd->mult, &cd->shift, rate, NSEC_PER_SEC, 60); | 37 | clocks_calc_mult_shift(&cd->mult, &cd->shift, rate, NSEC_PER_SEC, 0); |
38 | 38 | ||
39 | r = rate; | 39 | r = rate; |
40 | if (r >= 4000000) { | 40 | if (r >= 4000000) { |