Subject: Re: NTP pulse-per-second timestamp diff
To: Jonathan Stone <jonathan@dsg.stanford.edu>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: tech-kern
Date: 03/26/1998 16:47:55
On Thu, 26 Mar 1998, Jonathan Stone wrote:

> >To do this with the best accuracy possible requires using a special line
> >discipline; that's easy enough to add.  However, I'm wondering if there's
> >any gain in giving the serial port driver the ability to short-circuit
> >the soft interrupt processing and feed the data directly to the
> >line discipline routines, to help reduce latency and jitter.  The CHU
> >signal is supposed to be accurate to within 1ms, so I don't know if
> >doing this optimization would be lost in the noise
> 
> Solely from an NTP perspective, trading off reduced latency and (more
> importantly) reduced jitter for lower serial throughput is Always Good.
> 
> Since the CHU signal doesn't itself have a PPS signal, you cannot get
> around latency variations by using a PPS.
> 
> You're proposing we test the line discipline in the hard-interrupt
> service routine, and for ``NTP'' disciplines, handling the ldisc stuff
> immediately rather than deferring?
> 
> I think the real question is, can this NTP optimization be done
> without adversely affecting the quality of the serial driver(s)
> concerned.  I'd run this by whoever maintains the relevant serial
> drivers.

With some modifications, it could be done with the zstty driver.

The whole zsc driver calls routines whenever an interrupt happens. We
could change the status-change interrupt servicer (which'll see DTR
changes) when in such a line discipline. That way the change gets noticed
immediatly.

This idea is half-baked, though. Some code piece would need intemate
knowledge of both the line discipline and the chip-level driver.

I hve more ideas here, but will stop now as 1) I don't have time to code
them, and 2) they'd need some revision anyway.

Take care,

Bill