[-mm PATCH 1/11] Time: reduced ntp rework part 1 - fix adjtimeadj
From: john stultz
Date: Tue Feb 21 2006 - 01:19:15 EST
Syncs up the time-reduced-ntp-rework-part1.patch with the adjtime_adjustment() changes.
Signed-off-by: John Stultz <johnstul@xxxxxxxxxx>
kernel/timer.c | 28 +++++-----------------------
1 files changed, 5 insertions(+), 23 deletions(-)
Index: mm-merge/kernel/timer.c
===================================================================
--- mm-merge.orig/kernel/timer.c
+++ mm-merge/kernel/timer.c
@@ -590,7 +590,6 @@ static long time_adj; /* tick adjust (
long time_reftime; /* time at last adjustment (s) */
long time_adjust;
long time_next_adjust;
-long time_adjust_step; /* per tick time_adjust step */
/*
* this routine handles the overflow of the microsecond field
@@ -757,25 +756,7 @@ static void ntp_advance(unsigned long in
/* calculate the per tick singleshot adjtime adjustment step: */
while (interval_ns >= tick_nsec) {
- time_adjust_step = time_adjust;
- if (time_adjust_step) {
- /*
- * We are doing an adjtime thing.
- *
- * Prepare time_adjust_step to be within bounds.
- * Note that a positive time_adjust means we want
- * the clock to run faster.
- *
- * Limit the amount of the step to be in the range
- * -tickadj .. +tickadj:
- */
- time_adjust_step = min(time_adjust_step, (long)tickadj);
- time_adjust_step = max(time_adjust_step,
- (long)-tickadj);
-
- /* Reduce by this step the amount of time left: */
- time_adjust -= time_adjust_step;
- }
+ time_adjust -= adjtime_adjustment();
interval_ns -= tick_nsec;
}
@@ -851,11 +833,11 @@ static void update_wall_time(unsigned lo
{
do {
/*
- * Calculate the nsec delta using the precomputed NTP
+ * Calculate the nsec delta using the NTP
* adjustments:
- * tick_nsec, time_adjust_step, time_adj
+ * tick_nsec, adjtime_adjustment(), phase_advance()
*/
- long delta_nsec = tick_nsec + time_adjust_step * 1000;
+ long delta_nsec = tick_nsec + adjtime_adjustment() * 1000;
delta_nsec += phase_advance();
xtime_advance(delta_nsec);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/