Bug#1086000: ntpsec: ntpd runs with SCHED_FIFO 99 and might starve the system

Richard Laager rlaager at wiktel.com
Sat Mar 1 05:22:25 UTC 2025


This is from: https://bugs.debian.org/1086000

Does anyone have insight on this? Is running at real-time priority 
actually helpful to timekeeping accuracy?

If not, I'll remove this from the Debian package (and we should probably 
remove the option upstream entirely?).

If it is helpful, is there something we should be doing differently to 
avoid the risk of starving out kernel threads?

On 2024-10-24 09:24, Felix Moessbauer wrote:
> the ntpsec service starts the ntpd binary with the option "-N|--nice" (defined
> in ntpsec.default (/etc/default/ntpsec) [1]. By that, the ntpd will run with
> the highest possible priority, which is SCHED_FIFO, prio 99. These
> priorities are discouraged as this can starve kernel threads.

> Some recent stalls of PREEMPT_RT systems we observed could be related to
> this.
> 
> Despite this option being called "nice", it does not just set the
> niceness level. The corresponding code in ntpd is found in [2].
> Removing this option lets the ntpd run with SCHED_OTHER, prio 20.
> 
> [1] https://salsa.debian.org/debian/ntpsec/-/blob/debian/unstable/debian/ntpsec.default?ref_type=heads#L1
> [2] https://github.com/ntp-project/ntp/blame/9c75327c3796ff59ac648478cd4da8b205bceb77/ntpd/ntpd.c#L446

-- 
Richard



More information about the devel mailing list