diff options
author | John Stultz <[email protected]> | 2011-10-31 17:06:35 -0400 |
---|---|---|
committer | John Stultz <[email protected]> | 2011-11-10 11:27:08 -0800 |
commit | d65670a78cdbfae94f20a9e05ec705871d7cdf2b (patch) | |
tree | 3c16dedb75fa5ab6c0fdc072cc8d73df01d43a17 /net/unix/sysctl_net_unix.c | |
parent | e35f95b36e43f67a6f806172555a152c11ea0a78 (diff) |
clocksource: Avoid selecting mult values that might overflow when adjusted
For some frequencies, the clocks_calc_mult_shift() function will
unfortunately select mult values very close to 0xffffffff. This
has the potential to overflow when NTP adjusts the clock, adding
to the mult value.
This patch adds a clocksource.maxadj value, which provides
an approximation of an 11% adjustment(NTP limits adjustments to
500ppm and the tick adjustment is limited to 10%), which could
be made to the clocksource.mult value. This is then used to both
check that the current mult value won't overflow/underflow, as
well as warning us if the timekeeping_adjust() code pushes over
that 11% boundary.
v2: Fix max_adjustment calculation, and improve WARN_ONCE
messages.
v3: Don't warn before maxadj has actually been set
CC: Yong Zhang <[email protected]>
CC: David Daney <[email protected]>
CC: Thomas Gleixner <[email protected]>
CC: Chen Jie <[email protected]>
CC: zhangfx <[email protected]>
CC: [email protected]
Reported-by: Chen Jie <[email protected]>
Reported-by: zhangfx <[email protected]>
Tested-by: Yong Zhang <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions