[LinuxPPS] [PATCH 02b/12] PPS: Make pps_event capturing lockless.

Hal V. Engel hvengel at astound.net
Tue Feb 10 22:59:53 CET 2009


On Tuesday 10 February 2009 01:25:00 am Bernhard Schiffner wrote:
> On Tuesday 10 February 2009 04:57:48 George Spelvin wrote:
> > Rather than using spinlock mutual exclusion between pps_event
> > and PPS_FETCH, store captured timestamps into a circular buffer
> > and atomically update the sequence number to publish them to
> > PPS_FETCH.
> >
> > This technically has a race if more than 5 pps_events of a single type
> > arrive during one PPS_FETCH; given a typical 1 Hz rate, is that really
> > likely?
>
> (general)
> pps does timestamp interrupts.
> It's regular use is real "PPS". But it'is not limited to this.
>
> (more then5 events)
> PPS-events derivated form TAI (as in GPS-receivers) are very close together
> in their slopes  (<1µs).

Some will be well under 100 nanoseconds and some of the better devices are 
closer to +-10 nanoseconds.

> If you want this accuracy it makes no sense to use more then one (reliable)
> source.
> If you use two similar sources their respective interrupts block each other
> (a "long" time, ca. 30 µs) before getnstimeofday() can happen. This does
> not improve accuracy...
> So 5 "parallel" events should be ok FAPP.
>
> Bernhard

Some devices like the Oncore GPS allow us to have the PPS signal offset from 
actual time by a user specified amount for each device to avoid the issue with 
multiple devices causing interrupt collisions.  Even under those circumstances  
using more than 5 reference clocks seems like a real stretch and is probably 
highly unlikely.

Hal




More information about the LinuxPPS mailing list