Subject: clock interrupt logic
To: Frank Kardel <>
From: Garrett D'Amore <>
List: tech-kern
Date: 09/19/2006 10:35:29
While looking at the stuff in tc_windup(), it occurs to that as this is
called every clock interrupt (typically 100Hz), it would be really nice
if we could shorten the "default" code path.

For example, there is code in there to calculate changes resulting from
adjtime.  I suspect (though I'm no NTP expert) that the adjtime call is
only infrequently executed, and therefore recalculating the "th_scale"
(which includes multiplication by a non-power-of-2 number, and division
by the variable frequency), may be avoidable.  On some platforms these
are really expensive operations.

So maybe adjtime() or whatever could mark the scale as "dirty" and we
only do this code if it is so marked?   Just a thought....

Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
Phone: 951 325-2134  Fax: 951 325-2191