提交 edc4d272 编写于 作者: R Russell King

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: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 211baa70
...@@ -34,7 +34,7 @@ void __init init_sched_clock(struct clock_data *cd, void (*update)(void), ...@@ -34,7 +34,7 @@ void __init init_sched_clock(struct clock_data *cd, void (*update)(void),
sched_clock_update_fn = update; sched_clock_update_fn = update;
/* calculate the mult/shift to convert counter ticks to ns. */ /* calculate the mult/shift to convert counter ticks to ns. */
clocks_calc_mult_shift(&cd->mult, &cd->shift, rate, NSEC_PER_SEC, 60); clocks_calc_mult_shift(&cd->mult, &cd->shift, rate, NSEC_PER_SEC, 0);
r = rate; r = rate;
if (r >= 4000000) { if (r >= 4000000) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册