Received: from mout.gmx.com (mout.gmx.com [74.208.4.201]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 7EE4A782CB0 for <~alpine/devel@lists.alpinelinux.org>; Sat, 17 Jul 2021 18:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.com; s=dbd5af2cbaf7; t=1626545955; bh=udnSrOGvs0fYkkp398T1Q4afBRcUgo/AARaRaXkVXRI=; h=X-UI-Sender-Class:From:To:Subject:Date; b=TS1nvUvqYMeF7PgbTJjBlzJ7x61PTzlgGpRWudwOQNTaD8VnoO0ub/ySk+ARCsmfy +OFvylZ4qIIPB7w7FMN9VoRJSflvNR2oJRquiYjoj6DoAs47fsmx+qqxdDeUJFRYcJ Ukt8BltToYVnCt76Fa1A+z9ne1Ky8LiyZpKCYhnM= X-UI-Sender-Class: 214d933f-fd2f-45c7-a636-f5d79ae31a79 Received: from [68.4.28.217] ([68.4.28.217]) by web-mail.mail.com (3c-app-mailcom-lxa12.server.lan [10.76.45.13]) (via HTTP); Sat, 17 Jul 2021 20:19:15 +0200 MIME-Version: 1.0 Message-ID: From: John Miner To: ~alpine/devel@lists.alpinelinux.org Subject: Raspberry Pi default CPU scaling governor Content-Type: text/plain; charset=UTF-8 Date: Sat, 17 Jul 2021 20:19:15 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:lf+rbRzRrzbgXd/sdUP3PK20h20oJEALoUIebYYqbUeX9YXSkGDBg6tE0Hc98cPluieLK X1A5A8+/HLezhRXgIFSbxZ7LfqwBlpOjnnCIbPSH9L3Ax3sti/bEHQJTe94L7OIVJ5dIlus/Y4jn fyQTj9izb0yErTBs9hAYEDzvaYzyvcb8oxyVJ0cRlCHEzfpxhCB5mhz11tGHhlHgX0y7/ly9MXzB neAqI53fXpMCQu270LfkVW8lC7Yf6THozyzudHUu+cHd2ISKVmF7s3QwGzo5wc2utWNTU5G5Rei1 Fo= X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:nOxT9pLB3bI=:qKBnFzqh2IFQCp3ogfjoar OWUbZ1g5KlH0Efaf9XAYfS8Cd8faGP4zsaoDDJBSqS9q2LTFsDEI3cKb9E3My31oWfOljO8qD /C+nShoFoagRZrTrvr7UPmr9Sx/GXMwbfcjtsteSy+X9WfQSicdYkd08UsphvC7Ww9EN2+4nl e8VAJRN0hw0PtuCErssF67UQMZTb4pUzTiwX+Z655AyPpC13G8ZlmgnoL7qkNxybRnefV6JQN UhSJ1ZsEwUQhV1EWv6y7btOI+f8g/cTDB4ds8XliVeN5kk6SyDa45oMqJWZTD4xpMWc/9q0OH fCXibeHwI0trFio7h0I6ZU3Tg094im6e/DepX8k+nYULgCoPqovvEkH5iCtGl2zFlHi+N+UVU vtPSoa8e1qj0SOHfaFlts4Pi3jJqHBFxtPUk+fjAkYHJqYEzbKoi93+xN48wORTtBDQKyQN7i NG92VLuMO0h/GhftCDILv9MKHEeNu0KMs+hEeIm42j2FgdLLTZR5hshM32G3RgxvXXDdVklKO 9wwMdWG9D7z0xKPElJ78LwhOFFiXgTbx54mvzdfQ1iZ2lIDfba4XtwNDsk0iQ+76vO6Fr1+rp gZ1aUzWM+6vCV6LDxdpEurFQo64fDW28lKBjTlEM5lssnGApyRVJtn4OskP7AioJZ+K3eePZ/ wiHIByyTKsN6HnPZunDsQzX1p6iZ5FJs2ja3Zzw5P6M7gqJ8mdP5dryFdPqiSSPAyWE1VBHGM ymCkTmNQoAZJSL17Kag+csfK2liQpS0KpVpIYB+VoZ4GHd219yDW+o1+sWo+Smd/kJWBKrnLZ 3IgZ2gFAVsVc4A4rU7shynuwSdfhg== The default Alpine kernel for the Raspberry Pi images has the CPU scaling governor set to "powersave" which limits the maximum CPU frequency to 600MHz (the value at /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq) as the default config has CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE enabled. Other common RPI distributions have taken the approach to set the governor to "ondemand" which allows scaling of the frequency based on current load (including Arch Linux ARM and Rasbian). Arch Arm sets "ondemand" as the default in the config (CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y in https://github.com/archlinuxarm/PKGBUILDs/blob/master/core/linux-raspberrypi/config) and Raspberry Pi OS (f.k.a Raspbian) sets the default governor to "ondemand" when raspi-config is enabled (see logic at https://github.com/RPi-Distro/raspi-config/blob/master/debian/raspi-config.init where /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor is set to "ondemand"). For example, for the RPI3, setting the scaling_governor to "ondemand" allows the CPU to scale up to 1,200MHz based on load (the value at /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq) rather than limited to 600MHz in "powersave" mode. Has Alpine taken a position on what default CPU scaling governor should be in place for the images or is it simply using the upstream default config? It seems that users of the Alpine RPI images should be aware that the CPU frequency will be throttled at the minimum frequency and will not achieve the stated frequency as per the SBC specs in the default state. Two potential options if folks agree this is an issue: 1) take a position on which default scaling governor should be used (whether it is "ondemand" or other) and make that change to config-changes-rpi.armhf if it's not "powersave" or 2) update the Wiki so folks are aware of the CPU throttle and offer them an alternative (e.g., one can place the following command in /etc/local.d to set the governor to "ondemand") echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor The list of available governors: ondemand userspace powersave performance schedutil (at /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors) One can see the time at the various frequencies by issuing "cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state" in shell. For example, in "powersave" for RPI3, all the time is at 600MHz even under load: 600000 4812998 700000 0 800000 0 900000 0 1000000 0 1100000 0 1200000 0