current thinking on nohz=off?

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
eric71
Established Member
Posts: 128
Joined: Fri Jan 16, 2009 7:41 am
Location: Finland

current thinking on nohz=off?

Post by eric71 »

I remember a number of years ago when Ubunntu had started setting CONFIG_NO_HZ=y in their kernels and after updating to the latest version, my latency/xruns went to hell. The solution was to start adding nohz=off to my grub boot lines. So years have passed, and I have distrohopped a hundred times and as of late have been sticking to Ubuntu based distros (Mint for a while, last week Ubuntustudio, and this week Xubuntu 15.10) with kxstudio repos added. I have been installing the lowlatency kernel, adding myself to the audio group, and installing jackd automagically sets up limits.conf correctly. I haven't thought at all about dynamic ticks - only making sure that preempt and hz=1000 are correctly set in the kernel config. I checked today, and dynamic ticks is still enabled in current Ubuntu lowlatency kernels. I've been getting decent performance, but recently I've tried pushing latencies a little lower with my usb interface, without encouraging results. I remembered the nohz=off thing, googled a bit, and couldn't find anything newer than 3 or 4 years old on the topic. A search of nohz finds nothing on this forum.

I'm at work now, so I can't test if nohz=off helps on my system. In the meantime I'd just like to see if any of the low-latency experts on this forum have any information or personal experience with this. What settings are you using?
asbak
Established Member
Posts: 897
Joined: Thu Sep 11, 2014 3:04 pm
Has thanked: 71 times
Been thanked: 64 times

Re: current thinking on nohz=off?

Post by asbak »

CONFIG_PREEMPT=y
CONFIG_NO_HZ_COMMON=y
CONFIG_NO_HZ_IDLE=y
CONFIG_NO_HZ=y
CONFIG_HZ_1000=y
CONFIG_HZ=1000

I haven't tested this enough to be certain but another thing which may cause xruns at lower latencies is the use of jackd seq or raw MIDI.
a2jmidid may be a better way to access MIDI devices.
Some Focal / 20.04 audio packages and resources https://midistudio.groups.io/g/linuxaudio
gimmeapill
Established Member
Posts: 564
Joined: Thu Mar 12, 2015 8:41 am
Has thanked: 44 times
Been thanked: 8 times

Re: current thinking on nohz=off?

Post by gimmeapill »

For modern kernels (4.x), you shouldn't need to worry about that anymore. I ran some A/B comparisons a few months ago and couldn't find a difference.

Here's what we have at the moment for linux-rt in Arch:

Code: Select all

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
# CONFIG_NO_HZ is not set
CONFIG_HIGH_RES_TIMERS=y
eric71
Established Member
Posts: 128
Joined: Fri Jan 16, 2009 7:41 am
Location: Finland

Re: current thinking on nohz=off?

Post by eric71 »

gimmeapill wrote:For modern kernels (4.x), you shouldn't need to worry about that anymore. I ran some A/B comparisons a few months ago and couldn't find a difference.
I've just run some comparisons on kernel 4.4, and there was no noticeable difference, so this seems to be the case. Thanks gimmeapill and asbak :)
gimmeapill
Established Member
Posts: 564
Joined: Thu Mar 12, 2015 8:41 am
Has thanked: 44 times
Been thanked: 8 times

Re: current thinking on nohz=off?

Post by gimmeapill »

Thanks for the confirmation.

I took the liberty to report that:
https://github.com/raboof/realtimeconfi ... n/issues/4
Post Reply