Frogging-Family / linux-tkg

linux-tkg custom kernels
GNU General Public License v2.0
1.25k stars 157 forks source link

Set default to CONFIG_NO_HZ_FULL=y #938

Closed mabod closed 1 month ago

mabod commented 1 month ago

When you hit return through all the config questions of linux-tkg, you will get CONFIG_NO_HZ_IDLE=y

This seems to follow a recommendation from the kernel documentation:

Omit scheduling-clock ticks on idle CPUs (CONFIG_NO_HZ_IDLE=y or CONFIG_NO_HZ=y for older kernels). This is the most common approach, and should be the default.

Omit scheduling-clock ticks on CPUs that are either idle or that have only one runnable task (CONFIG_NO_HZ_FULL=y). Unless you are running realtime applications or certain types of HPC workloads, you will normally -not- want this option.

(from: https://docs.kernel.org/timers/no_hz.html)

But this recommendation seems to be obsolete. In 2021 a change was introduce to the kernel source which changes the help text for the NO_HZ options and it says:

CONFIG_NO_HZ_FULL:
...
By default, without passing the nohz_full parameter, this behaves just
like NO_HZ_IDLE.

If you're a distro say Y.

(from: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=176b8906c399a170886ea4bad5b24763c6713d61)

Distros like arch, debian or fedora all have CONFIG_NO_HZ_FULL=y Shouldnt that be the default for linux-tkg as well?

anh0516 commented 1 month ago

99% of people aren't going to use full dynticks. Distros enable it so that the 1% who do use it don't have to compile their own kernel or have the distro ship a second kernel. That's what the advice is about.

For people who are building their own kernel, it makes sense to set the default to what 99% of people are going to use and let people who want to use full dynticks and know what it is select it themselves. This is what TkG does.

Practically speaking, the only advantage to selecting NO_HZ_IDLE over NO_HZ_FULL without enabling full dynticks is tiny memory savings and reduced code complexity, if that is a concern.

mabod commented 1 month ago

Ok. I understand that. Makes sense.