On 2/17/20 11:06 AM, Miroslav Lichvar wrote:
On Fri, Feb 14, 2020 at 01:23:44PM +0200, Ville Heikkinen wrote:
In case there is no connection to the server, notify the kernel
that the clock is currently unsynchronized.
Is the idea to use the flag for monitoring phc2sys?
The idea is to monitor clock synchronization status: there could be
processes running in a container with a limited knowledge of the system.
Setting the flag would provide an easy way to those processes achieve this.
I'm not sure if that's how the UNSYNC flag is supposed to be used.
When the clock stops being updated by phc2sys, it doesn't mean it's
"unsynchronized", does it? It will slowly drift away and the kernel
will set the flag automatically when the maximum error (rising at 500
ppm) reaches 16 seconds.
It's true that the kernel sets the flag after a while, but it seems that
in some scenarios this takes too long.
It's not that clear that how the interfaces should be used, and the
specification is 25 years old. In any case, the interface is specified
in RFC 1589. It doesn't give much info how the interface should be used.
However, the author of the RFC, Mills, D.L., has written article "Unix
kernel modifications for precision time synchronization"
(https://www.eecis.udel.edu/~mills/database/reports/kern/kernb.pdf). In
there, it's specified that "STA_UNSYNC set/cleared by the caller to
indicate clock unsynchronized (e.g., when no peers are reachable)". So,
this is the reasoning why the flag could be used like this.
--
Ville Heikkinen
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel