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

Bernhard Schiffner bernhard at schiffner-limbach.de
Wed Feb 11 09:17:22 CET 2009


On Tuesday 10 February 2009 22:59:53 Hal V. Engel wrote:
> 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

Thanks for this comment.
(Your are the first mentioning this nice feature. Do you have data what is a 
needed shift between two clocks? (My setting is +100µs.)

The problem will be solved at an other level. Rodolfo said that a certain 
peace of code should be without (visible) problems by design. And he is IMO 
right.

(But it's definitly something nice to play with two or more clocks and 
different input paths.)

Bernhard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ml.enneenne.com/pipermail/linuxpps/attachments/20090211/0aa54f47/attachment-0001.htm 


More information about the LinuxPPS mailing list