OMVExtras InstallScript or OMV itself is changing cpufrequtils GOVERNOR during installation

  • I have a fresh armbian bullseye system with the following "/etc/default/cpufrequtils" file:

    Code
    ENABLE="true"
    MIN_SPEED="0"
    MAX_SPEED="0"
    GOVERNOR="schedutil"


    After using the OMVExtras InstallScript to install OpenMediaVault with OMVExtras the same file looks like this:

    Code
    ENABLE="true"
    GOVERNOR="ondemand"
    MAX_SPEED="0"
    MIN_SPEED="0"


    Also in "/etc/default/openmediavault" the cpufrequtils GOVERNOR was set to "ondemand" as default:

    Code
    OMV_CPUFREQUTILS_GOVERNOR="ondemand"


    In the source code of the InstallScript it seems the configuration gets copied with:

    Code
    cpuFreqDef="/etc/default/cpufrequtils"
    
    if [ -f "${cpuFreqDef}" ]; then
      . ${cpuFreqDef}

    But it still changes the GOVERNOR to "ondemand".


    I hope this can be fixed.

    • Official Post

    What is the output of:

    grep GOVERNOR /etc/default/cpufrequtils

    grep GOVERNOR /etc/default/openmediavault

    omv 7.7.5-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.4.5 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    The install script is setting OMV_CPUFREQUTILS_GOVERNOR in /etc/default/openmediavault and then running omv-salt stage run prepare. Salt should be doing the right thing and the install should be doing the right thing as long as /etc/default/cpufrequtils exists before starting the script.

    omv 7.7.5-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.4.5 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I did some tests and the GOVERNOR change in my "/etc/default/cpufrequtils" file happens at line 282 of the InstallScript during this command:

    Code
    280  aptFlags="--yes --auto-remove --show-upgraded --allow-downgrades --allow-change-held-packages --no-install-recommends"
    281  cmd="apt-get ${aptFlags} install openmediavault"
    282  if ! ${cmd}; then


    List of packages that get installed by this command:

    • Official Post

    did some tests and the GOVERNOR change in my "/etc/default/cpufrequtils" file happens at line 282 of the InstallScript during this command:
    Code

    That makes sense. The install script changes it after that line but omv changes the file that OMV is sourcing. I guess I need to get the value in /etc/default/cpufrequtils and store before omv is installed OR add an argument to the script to set it. Leaning toward the latter since most people don't know what to set it to.

    omv 7.7.5-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.4.5 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    Is the schedutil governor better for ARM devices? If so, why not let the cpufrequtils Salt state do the job? In that case i only need the output of salt-call grains.item osarch due the fact that i do not have an ARM device.


    I guess the code should look like:


    YAML
    {%- set governor = salt['pillar.get']('default:OMV_CPUFREQUTILS_GOVERNOR', salt['grains.filter_by']({
        "default": "ondemand",
        "amd64": "conservative",
        "i386": "conservative",
        "armhf": "schedutil",
        "arm64": "schedutil",
        "armel": "schedutil",
    }, grain="osarch")) -%}

    Did i miss an architecture?


    What is the default on a ARM Debian derivate like RaspiOS?

  • schedutil is recommended for heterogeneous CPU topologies like ARM big.LITTLE or Intel CPUs with different size cores because it supports energy aware scheduling. So it can correctly schedule tasks between small and big cores.


    Energy Aware Scheduling — The Linux Kernel documentation

    Intel P-State Driver Shifting To "Schedutil" Governor Default With Linux 5.7 - Phoronix


    I don’t know how to automatically detect a heterogeneous CPU in Linux. Some models have different max clock speeds for small and big cores. With “cat /proc/cpuinfo” the CPU variant & part parameter is different between CPU cores at least for ARM.


    RK3588s on Armbian example:


    • Official Post

    I don't want to make it too complicated. OMV is trying to use the best possible setup, but everything should be within reason and simple. So you suggest to default the governor to schedutil as shown in the code in my previous post? If users want a different one, they can use the environment variable to customize it.

  • I don't want to make it too complicated. So you suggest to default the governor to schedutil as suggested in my previous post? If users want a different one, they can use the environment variable to customize it.

    I don't think you can set all ARM to schedutil. What if they dont support it?


    If the InstallScript would save the setting from beeing overwritten during install that would be enough. And btw with schedutil governor the ionice/taskset part could be skipped.

    • Official Post

    I am working on testing changes I made to the install script. I noticed on a fresh install on my Orange Pi 5 Plus that the governor is set to ondemand by default by Armbian.


    The kernel does support schedutil.

    CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y


    I did notice the kernel defaults to schedutil as well.

    CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y


    Any idea why Armbian is not setting the default to schedutil on this bigLittle board? I think the install script was actually doing something better by using the kernel's default governor when /etc/default/cpufrequtils doesn't exist.

    omv 7.7.5-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.4.5 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Any idea why Armbian is not setting the default to schedutil on this bigLittle board? I think the install script was actually doing something better by using the kernel's default governor when /etc/default/cpufrequtils doesn't exist.

    They might use the same base files for all images. I don't think this is intentional since schedutil is definitly correct for big.LITTLE.


    Maybe read out Kernel default governor on Armbian and skip cpufrequtils file. Also could get rid of taskset list for big.LITTLE with schedutil.

    • Official Post

    They might use the same base files for all images. I don't think this is intentional since schedutil is definitly correct for big.LITTLE.

    I agree. According to this article, schedutil is the default for all arm cpus starting with the 5.9 kernel - https://www.phoronix.com/news/Linux-5.9-Power-Management


    Maybe read out Kernel default governor on Armbian and skip cpufrequtils file. Also could get rid of taskset list for big.LITTLE with schedutil.

    I think I will since the code is already written in the install script to figure this out.

    omv 7.7.5-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.4.5 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    Anything i have to do?

    I think it makes sense to make the default schedutil for arm* since it is the default in the kernel.

    omv 7.7.5-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.4.5 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I did a test with OpenMediaVault 6.8.0.-1 and during the installation of the openmediavault package it correctly changes the governor to schedutil now for my ARM64 RK3588s system.


    After installation:

    Code
    root@nanopi:~# cat /etc/default/cpufrequtils
    ENABLE="true"
    GOVERNOR="schedutil"
    MAX_SPEED="0"
    MIN_SPEED="0"


    ryecoaaron Could you skip the ionice/taskset part of the installscript when schedutil governor is detected? Or at least add a parameter for the script to skip the part?


    It makes no sense to taskset the processes because schedutil moves them between small and big cores already.

    • Official Post

    Could you skip the ionice/taskset part of the installscript when schedutil governor is detected? Or at least add a parameter for the script to skip the part?


    It makes no sense to taskset the processes because schedutil moves them between small and big cores already.

    I just finished testing and uploaded the new version of the install script that does skip the ionice setup when schedutil is the governor.

    installScript/install at master · OpenMediaVault-Plugin-Developers/installScript
    script that installs omv-extras and openmediavault if not installed already. - OpenMediaVault-Plugin-Developers/installScript
    github.com

    omv 7.7.5-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.2 | compose 7.4.5 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!