New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable tickless wothout kernel rebuild? #750

Closed
gm8arv opened this Issue Dec 29, 2014 · 8 comments

Comments

Projects
None yet
5 participants
@gm8arv
Copy link

gm8arv commented Dec 29, 2014

I have recent upgraded a number of Raspberry Pi cards to the current distribution, and noted that the timekeeping performance for a stratum-1 server with PPS as reported by NTP offset is a factor of about two worse than with my previous kernel which was compiled without the "tickless" option. Current version: Linux raspi-6 3.12.35+ #730 PREEMPT Fri Dec 19 18:31:24 GMT 2014 armv6l GNU/Linux

Is there any way to select non-tickless operation at run time - such as a boot command-line option - so that the good timekeeping performance might be restored? I would very much prefer to use the stick kernel rather than recompiling - as the GPIO-PPS support is now built-in and very helpful thanks!

(It was suggested that I post this request here.)

Thanks,
David

@kukabu

This comment has been minimized.

Copy link

kukabu commented Dec 29, 2014

Try nohz=off in kernel cmdline.

@gm8arv

This comment has been minimized.

Copy link

gm8arv commented Dec 29, 2014

Thanks, kukabu. I tried that but it didn't make any difference. I see now that someone reported similar results earlier. Can you or anyone confirm that the stock Raspian supports nohz=off, and if not, could it be added, please?

@ncguk

This comment has been minimized.

Copy link

ncguk commented Dec 30, 2014

I'd like to second this request. A functioning nohz=off would be a valuable addition for people running or trying to run a stratum 1 NTP server, especially in light of this recent NTP bug fix: http://bugs.ntp.org/show_bug.cgi?id=2314

tl:dr; Until recently on tickless kernels NTP would look as though it were using the kernel clock discipline when instructed to but was in fact silently ignoring it. NTP now correctly fails to use the kernel discipline on tickless kernels, and will only use it on kernels with tickless disabled. So, though we can now easily enable PPS in the Raspbian kernel (hooray), NTP will ignore (and always has ignored) it at the kernel level (not hooray).

@Ruffio

This comment has been minimized.

Copy link

Ruffio commented Aug 10, 2016

@gm8arv has this issue been resolved? If yes, please close this issue. Thanks.

@gm8arv

This comment has been minimized.

Copy link

gm8arv commented Aug 11, 2016

The comment referred to a rather old version of the OS. Is there now a nohz=on option for the current Raspbian?

@P33M

This comment has been minimized.

Copy link
Contributor

P33M commented Aug 11, 2016

Adding nohz=off to /boot/cmdline.txt has the following effects:

Default:

pi@raspberrypi:~$ vmstat 2
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 681776  13860 106112    0    0  1580    32  607  795 10 14 64 12  0
 0  0      0 681280  13860 106140    0    0     0     0  562  259  0  1 99  0  0
 0  0      0 681280  13860 106140    0    0     0     0  336   45  0  0 100  0  0
 0  0      0 681024  13868 106140    0    0     0     6  468  251  1  1 99  0  0
 0  0      0 680892  13868 106140    0    0     0     0  359   80  0  0 100  0  0
 0  0      0 681048  13868 106140    0    0     0     0  435  228  1  1 98  0  0

nohz=off:

pi@raspberrypi:~$ vmstat 2
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 681696  13632 106104    0    0  1072    21  487  562  7 10 76  8  0
 0  0      0 681656  13632 106132    0    0     0     0  806  114  0  0 100  0  0
 0  0      0 681488  13632 106132    0    0     0     0  794  260  1  1 98  0  0
 0  0      0 681504  13632 106132    0    0     0     0  706   73  0  0 100  0  0

So it appears that scheduling interrupts occur far more often. We've also switched to voluntary preemption, which may have a beneficial effect for more precise timestamping.

@P33M P33M closed this Aug 11, 2016

@gm8arv

This comment has been minimized.

Copy link

gm8arv commented Aug 11, 2016

Thanks for that, I will test it out here and see whether there really is any difference as far as NTP is concerend.

@gm8arv

This comment has been minimized.

Copy link

gm8arv commented Aug 12, 2016

When "nohz=off" was added, on some systems there was no change, on others the NTP jitter was "halved" (approximately). I ended up with: ~ 4 µs jitter on RasPi B/B+, 2 µs on model 2 B, and 1 µs on model 3, when using PPS sources with well under 0.1 µs jitter. Just as a rough guide.

http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html#nohz

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment