[Need Help] time: questions about kernel function timekeeping_bigadjust()

Dong Zhu bluezhudong at gmail.com
Fri Mar 22 03:26:10 EDT 2013


Hi All,

Could anybody explain the following kernel code for me in detail ? I am
royally confused on it.

kernel/time/timekeeping.c

timekeeping_bigadjust()
{
        /*   
         * Use the current error value to determine how much to look ahead.
         * The larger the error the slower we adjust for it to avoid problems
         * with losing too many ticks, otherwise we would overadjust and
         * produce an even larger error.  The smaller the adjustment the
         * faster we try to adjust for it, as lost ticks can do less harm
         * here.  This is tuned so that an error of about 1 msec is adjusted
         * within about 1 sec (or 2^20 nsec in 2^SHIFT_HZ ticks).
         */
        error2 = tk->ntp_error >> (NTP_SCALE_SHIFT + 22 - 2 * SHIFT_HZ);
}


Thanks in advance.


-- 
Best Regards,
Dong Zhu

MySite: http://bluezd.info



More information about the Kernelnewbies mailing list