Re: gettimeofday non-monotonic on SMP 2.3.47

From: Boris Okun (bokun@home.com)
Date: Thu Mar 02 2000 - 11:59:10 EST


Hi,

I don't quite understand the logic of lost_ticks in do_gettimeofday().
Andrea, could you explain it to me? I think this code really belongs to
do_fast_gettimeoffset() for the following 2 reasons:
1) When using do_slow_gettimeoffset() it's erroneus.
2) You want to take lost_ticks into account in do_settimeofday() (when
undoing do_gettimeoffset().

To solve my problem I made the following changes (thanks to Artur
Skawina):
1) Made tsc_quotient[NR_CPUS] a per processor value
2) Move calls to calibrate_tsc() to the same places where we call
calibrate_delay
2) Made last_tsc[NR_CPUS] a full 64 bit, instead of just last_tsc_low.
3) Made delay_at_last_interrupt[NR_CPUS]
4) Deleted lost_ticks code from do_gettimeofday. Use instead the full
difference
between current_tsc and last_tsc in do_fast_gettimeoffset(), not just
LSB.

Perhaps tsc_quotient should be a part of cpu_info, and calibrate_tsc()
should be merged with calibrate_delay().

Now I have a perfectly monotone time and my interactive problems are
gone -- perfectly usable SMP system with different processors (despite
all naysayers ;-). If there is any interest I can post a patch.

Thanks all for your help.

Boris

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:12 EST