linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] gettimeofday stability
@ 2001-04-16 16:00 Iain Sandoe
  2001-04-16 22:19 ` Dan Malek
  0 siblings, 1 reply; 18+ messages in thread
From: Iain Sandoe @ 2001-04-16 16:00 UTC (permalink / raw)
  To: Gabriel Paubert; +Cc: linuxppc-dev, Samuel Rydh


> I still object strongly to anything touching the timebase, however.

I'd prefer if it wasn't touched too... I've used it in both the IRQ blocking
measurement stuff (yet to be ported to 2.4.x) and the Audio Latency
measurement stuff (PPC port of Benno Sennoner's stuff)...

I thought I could rely on TB ;-))

ciao,
Iain.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH] gettimeofday stability
@ 2001-04-11 19:00 Samuel Rydh
  2001-04-11 19:42 ` Gabriel Paubert
  0 siblings, 1 reply; 18+ messages in thread
From: Samuel Rydh @ 2001-04-11 19:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Benjamin Herrenschmidt


I'd like to suggest the following modification of do_gettimeofday():


===== time.c 1.8 vs edited =====
--- 1.8/arch/ppc/kernel/time.c  Mon Apr  2 03:36:42 2001
+++ edited/time.c       Wed Apr 11 20:38:42 2001
@@ -212,6 +212,10 @@
        sec = xtime.tv_sec;
        usec = xtime.tv_usec;
        delta = tb_ticks_since(tb_last_stamp);
+
+       if( (int)delta < 0 )
+               delta = 0;
+
 #ifdef CONFIG_SMP
        /* As long as timebases are not in sync, gettimeofday can only
         * have jiffy resolution on SMP.


Normally, delta should be strictly positive. However, if
coherency between DEC and TB is lost, then delta might turn
out to be (slightly) negative, which results in a
bogus time stamp.

The main reason why I want this modification is that MOL
touches both DEC and TB. I've not managed to maintain
exact coherency (appears to be more or less impossible).
The fix above would guard against an occasional drift.

/Samuel


----------------------------------------------------------
 E-mail <samuel@ibrium.se>  WWW: <http://www.ibrium.se>
  Phone/fax: (home) +46 8 4418431, (work) +46 8 7908470
----------------------------------------------------------

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2001-04-21 19:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-16 16:00 [PATCH] gettimeofday stability Iain Sandoe
2001-04-16 22:19 ` Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2001-04-11 19:00 Samuel Rydh
2001-04-11 19:42 ` Gabriel Paubert
2001-04-11 20:09   ` Karim Yaghmour
2001-04-11 21:31     ` Benjamin Herrenschmidt
2001-04-12 18:09     ` Gabriel Paubert
2001-04-14  6:49       ` Karim Yaghmour
2001-04-16 11:56         ` Gabriel Paubert
2001-04-16 13:25           ` Benjamin Herrenschmidt
2001-04-16 12:53             ` Gabriel Paubert
2001-04-17 11:22     ` Gabriel Paubert
2001-04-11 23:07   ` Samuel Rydh
2001-04-16 11:25     ` Gabriel Paubert
2001-04-19 20:43       ` Samuel Rydh
2001-04-21 15:21         ` Gabriel Paubert
2001-04-21 18:16           ` Samuel Rydh
2001-04-21 19:37             ` Gabriel Paubert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).