Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: M. Warner Losh
Date: Monday, September 27, 2010 - 9:14 am

In message: <alpine.DEB.2.00.1009271038150.9258@router.home>
            Christoph Lameter <cl@linux.com> writes:
: On Thu, 23 Sep 2010, john stultz wrote:
: > The design actually avoids most userland induced latency.
: >
: > 1) On the PTP hardware syncing point, the reference packet gets
: > timestamped with the PTP hardware time on arrival. This allows the
: > offset calculation to be done in userland without introducing latency.
: 
: The timestamps allows the calculation of the network transmission time I
: guess and therefore its more accurate to calculate that effect out. Ok but
: then the overhead of getting to code in user space (that does the proper
: clock adjustments) is resulting in the addition of a relatively long time
: that is subject to OS scheduling latencies and noises.

The timestamps at the hardware level allow you to factor out variation
caused by OS Scheduling, OS network stack delay and internal buffering
on the NIC.  Variation in measurements is what kills accuracy.

When steering a clock by making an error measurement of the phase and
frequency of it, the latency induced by OS scheduling tends to be
unimportant.  It is far more important to know when you steered the
clock (called adjtime or friends) than to steer it at any fixed
latency to when the data for the measurements was made.  Measuring the
time of steer can tolerate errors in the range of OS scheduling
latencies easily, since that tends to produce a very small effect.  It
introduces an error in your expected phase for the next measurement on
the order of the product of the time of steer error times the change
in fractional frequency (abs( 1 - (nu_new / nu_old))).  Even if the
estimate is really bad at 100ms, most steers are on the order about
one part per million.  This leads to a sub-nanosecond phase error
estimate in the next measurement cycle (a non-accumulating error).  A
1ms error leads to maybe tens of picoseconds of estimate error.

This is a common error that I've seen repeated in this thread.  The
only reason that it has historically been important is because when
you are doing timestamping in software based on an interrupt, that
stuff does matter.

Warner
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Richard Cochran, (Thu Sep 23, 10:30 am)
[PATCH 2/8] posix clocks: dynamic clock ids., Richard Cochran, (Thu Sep 23, 10:31 am)
[PATCH 3/8] posix clocks: introduce a sysfs presence., Richard Cochran, (Thu Sep 23, 10:31 am)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Christoph Lameter, (Thu Sep 23, 10:53 am)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Christoph Lameter, (Thu Sep 23, 11:36 am)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Christoph Lameter, (Thu Sep 23, 12:15 pm)
Re: [PATCH 6/8] ptp: Added a clock that uses the eTSEC fou ..., Christoph Lameter, (Thu Sep 23, 12:17 pm)
Re: [PATCH 6/8] ptp: Added a clock that uses the eTSEC fou ..., Christoph Lameter, (Thu Sep 23, 1:32 pm)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Christoph Lameter, (Thu Sep 23, 1:49 pm)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Christian Riesch, (Thu Sep 23, 2:34 pm)
Re: [PATCH 1/8] posix clocks: introduce a syscall for cloc ..., Benjamin Herrenschmidt, (Thu Sep 23, 6:20 pm)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Richard Cochran, (Fri Sep 24, 1:33 am)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Richard Cochran, (Fri Sep 24, 6:14 am)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Richard Cochran, (Fri Sep 24, 6:50 am)
Re: [PATCH 1/8] posix clocks: introduce a syscall for cloc ..., Benjamin Herrenschmidt, (Fri Sep 24, 3:12 pm)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Christoph Lameter, (Mon Sep 27, 8:37 am)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Christoph Lameter, (Mon Sep 27, 8:52 am)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Christoph Lameter, (Mon Sep 27, 8:56 am)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, M. Warner Losh, (Mon Sep 27, 9:14 am)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Richard Cochran, (Mon Sep 27, 11:34 pm)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Richard Cochran, (Mon Sep 27, 11:47 pm)
Re: [PATCH v6 0/8] ptp: IEEE 1588 hardware clock support, Christian Riesch, (Wed Sep 29, 8:50 pm)