time: Questions about kernel function timekeeping_bigadjust()

Dong ZHu bluezhudong at gmail.com
Sat Mar 23 07:08:28 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130323/45725fb1/attachment-0001.html 


More information about the Kernelnewbies mailing list