lkml.org 
[lkml]   [2000]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: gettimeofday non-monotonic on SMP 2.3.47
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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.176 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site