Skip to content

Commit

Permalink
rockchip_linux_defconfig: use the CPUFreq governor 'ondemand' as default
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen <[email protected]>
  • Loading branch information
RadxaStephen committed Jul 22, 2022
1 parent 1f170a1 commit 55f540c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm64/configs/rockchip_linux_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ CONFIG_ARM_PSCI_CPUIDLE=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_TIMES=y
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
CONFIG_CPUFREQ_DT=y
CONFIG_ARM_ROCKCHIP_CPUFREQ=y
CONFIG_ARM_SCMI_PROTOCOL=y
Expand Down

2 comments on commit 55f540c

@ThomasKaiser
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep in mind that ondemand is in fact a problem wrt I/O performance unless the necessary tweaks are applied:

This should work on boards with single or multiple CPU clusters:

prefix="/sys/devices/system/cpu"
CPUFreqPolicies=($(ls -d ${prefix}/cpufreq/policy? | sed 's/freq\/policy//'))
if [ ${#CPUFreqPolicies[@]} -eq 1 -a -d "${prefix}/cpufreq" ]; then
	# if there's just a single cpufreq policy ondemand sysfs entries differ
	CPUFreqPolicies=${prefix}
fi
for i in ${CPUFreqPolicies[@]}; do
	affected_cpu=$(tr -d -c '[:digit:]' <<< ${i})
	echo ondemand >${prefix}/cpu${affected_cpu:-0}/cpufreq/scaling_governor
	echo 1 >${i}/cpufreq/ondemand/io_is_busy
	echo 25 >${i}/cpufreq/ondemand/up_threshold
	echo 10 >${i}/cpufreq/ondemand/sampling_down_factor
	echo 200000 >${i}/cpufreq/ondemand/sampling_rate
done

See https://www.cnx-software.com/2022/07/20/rock-5b-rk3588-sbc-preview-what-works-what-doesnt-in-debian-11/#comment-594764 for results.

BTW: since you're about to get more reviews soon the best you could do for now is to set CPUFreq governor to performance since as you can see in the link above kitchen-sink tools like Phoronix Test Suite perform crappy with ondemand. That's how Hardkernel is doing it with all their ODROIDs since years. Set governor to performance and publish consumption numbers with ondemand. Media coverage then contains the nice consumption figures and the high benchmark scores.

@ThomasKaiser
Copy link

@ThomasKaiser ThomasKaiser commented on 55f540c Aug 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://openbenchmarking.org/result/2208036-NE-2208032NE57

performance ......... 502.96 |=======================================
schedutil ........... 543.28 |=============================================
ondemand ............ 549.89 |==============================================
ondemand/io_is_busy . 502.43 |=======================================

Please sign in to comment.