Bug 1193154 - permit differential fwd/back threshold for step vs. slew [PATCH]
Summary: permit differential fwd/back threshold for step vs. slew [PATCH]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ntp
Version: 7.0
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Miroslav Lichvar
QA Contact: Jakub Prokes
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-16 17:06 UTC by Jeremy Harris
Modified: 2015-11-19 08:38 UTC (History)
5 users (show)

Fixed In Version: ntp-4.2.6p5-20.el7
Doc Type: Enhancement
Doc Text:
This update adds the ability to configure separate clock stepping thresholds for each direction (backward and forward). Use the "stepback" and "stepfwd" options to configure each threshold.
Clone Of:
Environment:
Last Closed: 2015-11-19 08:38:34 UTC
Target Upstream Version:


Attachments (Terms of Use)
Suggested implementation (34.72 KB, application/x-gzip)
2015-02-16 17:06 UTC, Jeremy Harris
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Network Time Protocol 2763 0 None None None Never
Network Time Protocol 2811 0 None None None Never
Red Hat Product Errata RHSA-2015:2231 0 normal SHIPPED_LIVE Moderate: ntp security, bug fix, and enhancement update 2015-11-19 09:03:04 UTC

Description Jeremy Harris 2015-02-16 17:06:55 UTC
Created attachment 992270 [details]
Suggested implementation

Description of problem:

  RFE: to better support regaining sync while maintaining monotonic time,
implement separate "tinker step" variant commands for the config file
to set the forward and backward slew-size limits separately.
Patch series attached.

The typical use config would have a small (maybe default) forward
slew-limit and a large backward one.  Sizeable forward steps would be
made, but medium backward adjustment would still be done by slewing.

The large number of time-sensitive applications that fail on time apparently
repeating, due to a backward step, will be better supported.  However,
forward steps (which trouble fewer applications) will still be made.

Version-Release number of selected component (if applicable):

  RHEL7 has 4.2.6p5-19.el7_0
  Patchset applies to ntp-4.2.8p1


Additional info:

 Use case: a virtual machine where the VM support does not provide good time
service, resulting in a high apparent jitter with large forward steps.  Might
also be used in hibernate or sleep environments.

 ntp.conf(5) does not actually discuss the tinker command.

Comment 2 Miroslav Lichvar 2015-02-17 08:46:51 UTC
I think this would be an interesting feature. The patch looks good to me, only it should probably disable the kernel discipline when either of the two thresholds is larger than 0.5 as the kernel doesn't accept larger offsets.

Will you file a bug with the patch in the upstream bugzilla (https://bugs.ntp.org) or do you want me to do it?

Comment 3 Jeremy Harris 2015-02-17 09:37:17 UTC
The change you point out seems reasonable.  We should probably also add a docs
note clarifying the side-effect and noting (any?) disadvantages.  Would we expect
a higher-noise lock running the userland rather than kernel implementation?

I'm happy for you to propose it upstream; thanks.

Comment 4 Miroslav Lichvar 2015-02-20 13:56:43 UTC
Upstream bug:
https://bugs.ntp.org/show_bug.cgi?id=2763

(In reply to Jeremy Harris from comment #3)
> Would we expect a higher-noise lock running the userland rather
> than kernel implementation?

Possibly. It depends on how noisy are the NTP sources and how stable is the clock. Sometimes disabling kernel discipline worsens the quality of the timekeeping, sometimes it improves it. The two disciplines are slightly different.

Comment 6 Miroslav Lichvar 2015-04-22 14:43:16 UTC
This is now included in the upstream code.

However, there seems to be a problem when recovering from a large slew when step threshold in the opposite direction has the default value. We may need to limit the minimum value when the thresholds are allowed to differ.

https://bugs.ntp.org/show_bug.cgi?id=2811

Comment 7 Jeremy Harris 2015-05-15 09:00:16 UTC
For my interest, in that problem noted upstream (bug 2811) - why did the PLL accumulate a frequency offset?  Is it unlocked during the slew, and if so why given that we know the slew rate?

Comment 8 Miroslav Lichvar 2015-05-15 11:05:03 UTC
(In reply to Jeremy Harris from comment #7)
> For my interest, in that problem noted upstream (bug 2811) - why did the PLL
> accumulate a frequency offset?  Is it unlocked during the slew, and if so
> why given that we know the slew rate?

It's a limitation of the loop design. It can't adjust phase without adjusting also frequency. With a large phase offset a large frequency offset will be accumulated, which will then need a long time to get back to the correct value. This is one of the things that chrony does much better.

Comment 12 errata-xmlrpc 2015-11-19 08:38:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-2231.html


Note You need to log in before you can comment on or make changes to this bug.