public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: LTP - gettimeofday02 FAIL
@ 2002-11-19  1:27 Jim Houston
  2002-11-19 12:03 ` Andi Kleen
  2002-11-19 13:37 ` [LTP] " Paul Larson
  0 siblings, 2 replies; 9+ messages in thread
From: Jim Houston @ 2002-11-19  1:27 UTC (permalink / raw)
  To: linux-kernel, high-res-timers-discourse, ltp-list, jim.houston,
	plars


Hi Everyone,

I just tried gettimeofday02 on an old pentium-pro dual processor, and yes
the time goes backwards with a 2.5.48 kernel.

I believe that this is the result of lost ticks.  It has gotten much
easier to lose a tick since HZ was changed to 1000.  When the timer
interrupt is delayed, the other processors will continue to keep reasonable
time (based on the TSC), but when the timer interrupt eventually happens,
it will add one tick's worth of nanoseconds to xtime.tv_nsec and set
last_tsc_low to the current tsc value.  The other processors now base
their time on this new last_tsc_low and  will see time go backwards.
I accidentally configured in the ACPI power management code and was
disappointed to find that it routinely caused a 9 milli-second interrupt
lock-out (on my 1GHz Athlon).  With the old 100 Hz clock, this delay would
be detected by reading the PIT timer.  With 1000 Hz, the timer would  reload
several times and all we see is a fraction of a tick.

I'm interested in this because I'm working on my "alternative Posix timers
patch".  It gets confused when time backs up.

Jim Houston - Concurrent Computer Corp.

^ permalink raw reply	[flat|nested] 9+ messages in thread
* LTP - gettimeofday02 FAIL
@ 2002-11-12 22:11 Paul Larson
  2002-11-14 21:52 ` Chris Wedgwood
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Larson @ 2002-11-12 22:11 UTC (permalink / raw)
  To: lkml

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

I've been getting a somewhat random error in a few of the recent 2.5
kernels with SMP machines.  I noticed this on a 2.5.47 bk pull, but I
was also able to reproduce it on 2.5.46.  I haven't tried any earlier
kernels yet.  The LTP gettimeofday02 test sometimes fails with this
message:
gettimeofday02    0  INFO  :  checking if gettimeofday is monotonous,
takes 30s
gettimeofday02    1  FAIL  :  Time is going backwards (old
1037138184.846333 vs new 1037138184.843346!

I have not been able to reproduce this on a single processor machine
though.

Basically, all the test does is:
gettimeofday(&tv1, NULL);
while(!done) {
	gettimeofday(&tv2, NULL);
	FAIL if tv2 < tv1
	tv1 = tv2;
}

Any ideas on what could be causing this?

Thanks,
Paul Larson

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 240 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-11-19 14:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-19  1:27 LTP - gettimeofday02 FAIL Jim Houston
2002-11-19 12:03 ` Andi Kleen
2002-11-19 13:37 ` [LTP] " Paul Larson
2002-11-19 14:02   ` Dave Jones
2002-11-19 14:50     ` Paul Larson
  -- strict thread matches above, loose matches on Subject: below --
2002-11-12 22:11 Paul Larson
2002-11-14 21:52 ` Chris Wedgwood
2002-11-18 17:34   ` Paul Larson
2002-11-18 21:58     ` Chris Wedgwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox