Difference between revisions of "R-Car/Default-CPUFreq-governor-from-v5-9"

From eLinux.org
Jump to: navigation, search
 
(No difference)

Latest revision as of 18:07, 9 June 2021

Overview

From Linux kernel v5.9, since the following commit has been applied, the default CPUFreq governor has been changed from performance to schedutil. So, benchmark scores on R-Car Gen3 SoCs are possible to be down if we use the defconfig.

f259eab3ea0e cpufreq: make schedutil the default for arm and arm64

bonnie++ score comparation

When we use "schedutil" on buildroot v2020.02.10, the score of bonnie++ is down.

CPUFreq gov result (seq input block)
schedutil 158838
performance 181281

Environment:

  • R-Car H3 Salvator-XS
  • Kernel v5.12
  • Buildroot 2020.02.10
  • benchmark target : on board eMMC

how to change the CPUFreq governor from schedutil to performance again?

We have some ways like below.

  • sysfs
  • kernel config

sysfs

echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo performance > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor

kernel config

CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y

If we use "make menuconfig", the location is the following.

Location:
  -> CPU Power Management
    -> CPU Frequency scaling
      -> CPU Frequency scaling (CPU_FREQ [=y])
        -> Default CPUFreq governor (<choice> [=y])

clk tracing while bonnie++ is running

The following graph is tracing of clk_set_rate() while bonnie++ was running.

mount -t ext4 /dev/mmcblk0p1 /mnt
cd /mnt
echo 1 > /sys/kernel/debug/tracing/events/clk/enable
bonnie\+\+ -d ./ -u root
cat /sys/kernel/debug/tracing/trace > clk.txt
(adjusted clk.txt manually, and generated the graph by a local script by using matplotlib)

Clk.png

  • Remarks:
    • blue = Cortex-A57
      • 1.497GHz = 1865 times
      • 0.982GHz = 2178 times
      • 0.468GHz = 602 times
    • orange = Cortex-A53
      • 1.198GHz = 4952 times
      • 0.973GHz = 4008 times
      • 0.786GHz = 1749 times

According to the graph, almost all period of Cortex-A57 is 1.5GHz, but sometimes the clock rate was down. So, benchmark score was down.

Bonnie++ scores

on schedutil

Version 1.03e       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
buildroot    15640M 53238  97 134449  51 65647  26 55307  96 158838  41  5232  24
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 24717  98 +++++ +++ 25869  90 25207  98 +++++ +++ 26408  97
buildroot,15640M,53238,97,134449,51,65647,26,55307,96,158838,41,5232.5,24,16,24717,98,+++++,+++,25869,90,25207,98,+++++,+++,26408,97

on performance

Version 1.03e       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
buildroot    15640M 53640  97 146354  46 75991  22 55093  96 181281  26  6231  20
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 25272  98 +++++ +++ 28239  97 22793  88 +++++ +++ 26407  97
buildroot,15640M,53640,97,146354,46,75991,22,55093,96,181281,26,6231.0,20,16,25272,98,+++++,+++,28239,97,22793,88,+++++,+++,26407,97