Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\time\timekeeping.c Create Date:2022-07-28 10:42:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Adjust the timekeeper's multiplier to the correct frequency* and also to reduce the accumulated error value.

Proto:static void timekeeping_adjust(struct timekeeper *tk, s64 offset)

Type:void

Parameter:

TypeParameterName
struct timekeeper *tk
s64offset
1907  If Value is more likely to compile time(The ntp_tick_length() value currently being used.* This cached copy ensures we consistently apply the tick* length for an entire tick, as ntp_tick_length may change* mid-tick, and we don't want to apply that new value to* the tick in progress. == Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. ) Then
1908  mult = mult - ntp_err_mult
1909  Else
1910  The ntp_tick_length() value currently being used.* This cached copy ensures we consistently apply the tick* length for an entire tick, as ntp_tick_length may change* mid-tick, and we don't want to apply that new value to* the tick in progress. = Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT.
1911  mult = div64_u64 - unsigned 64bit divide with 64bit divisor*@dividend: 64bit dividend*@divisor: 64bit divisor* This implementation is a modified version of the algorithm proposed* by the book 'Hacker's Delight'. The original source and full proof
1921  ntp_err_mult = If Difference between accumulated time and NTP time in ntp* shifted nano seconds. > 0 Then 1 Else 0
1922  mult += ntp_err_mult
1924  Apply a multiplier adjustment to the timekeeper
1926  If Value for the false possibility is greater at compile time(maxadj && (abs - return absolute value of an argument*@x: the value. If it is unsigned type, it is converted to signed type first.* char is treated as if it was signed (regardless of whether it really is)* but the macro's return type is preserved as char.(mult - mult) > maxadj)) Then
1929  Print a one-time message (analogous to WARN_ONCE() et al):(warning conditions "Adjusting %s more than 11%% (%ld vs %ld)\n", name, (long)mult, (long)mult + maxadj)
1945  If Value for the false possibility is greater at compile time((s64)xtime_nsec < 0) Then
1946  xtime_nsec += NSEC_PER_SEC << shift
1948  xtime_sec--
1949  Flag used to avoid updating NTP twice with same second = 1
Caller
NameDescribe
timekeeping_advancemekeeping_advance - Updates the timekeeper to the current time and* current NTP tick length