Why cpuinfo_cur_freq fluctuation under max performance

I have some confusion about tegrastats return log.

Firstly we use sudo ./jetson_clocks.sh to enable all 6 CPUs to max performance. Then use sudo ./jetson_clocks.sh --show to verify act ivied result.
nvidia@tegra-ubuntu:~$ sudo ./jetson_clocks.sh --show
SOC family:tegra186 Machine:quill
Online CPUs: 0-5
CPU Cluster Switching: Disabled
cpu0: Gonvernor=schedutil MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
cpu1: Gonvernor=schedutil MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
cpu2: Gonvernor=schedutil MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
cpu3: Gonvernor=schedutil MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
cpu4: Gonvernor=schedutil MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
cpu5: Gonvernor=schedutil MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
GPU MinFreq=1300500000 MaxFreq=1300500000 CurrentFreq=1300500000
EMC MinFreq=40800000 MaxFreq=1866000000 CurrentFreq=1866000000 FreqOverride=1
Fan: speed=255

But when we use ./tegrastats to monitor current CPU freq, ./tegrastats return the stable 2035MHz as expected, but if use sudo ./tegrastats, we can see current CPU freq is vary (2038/2031/2031/1997).

nvidia@tegra-ubuntu:~$ sudo ./tegrastats 
RAM 930/7846MB (lfb 1578x4MB) CPU [0%@2038,0%@2035,0%@2035,0%@2036,0%@2035,0%@2034] EMC_FREQ 0%@1866 GR3D_FREQ 0%@1300 APE 150 MTS fg 0% bg 4% BCPU@49C MCPU@49C GPU@55C PLL@49C AO@46.5C Tboard@43C Tdiode@47.25C PMIC@100C thermal@48.2C VDD_IN 3435/3435 VDD_CPU 389/389 VDD_GPU 146/146 VDD_SOC 778/778 VDD_WIFI 0/0 VDD_DDR 1136/1136
RAM 931/7846MB (lfb 1578x4MB) CPU [0%@2031,0%@2035,0%@2035,0%@2034,0%@2034,0%@2036] EMC_FREQ 0%@1866 GR3D_FREQ 0%@1300 APE 150 MTS fg 0% bg 0% BCPU@49C MCPU@49C GPU@55C PLL@49C AO@47C Tboard@43C Tdiode@47.25C PMIC@100C thermal@48C VDD_IN 3387/3411 VDD_CPU 389/389 VDD_GPU 146/146 VDD_SOC 778/778 VDD_WIFI 0/0 VDD_DDR 1117/1126
RAM 931/7846MB (lfb 1578x4MB) CPU [0%@2033,0%@2035,0%@2034,0%@2035,0%@2035,0%@2035] EMC_FREQ 0%@1866 GR3D_FREQ 0%@1300 APE 150 MTS fg 0% bg 0% BCPU@49C MCPU@49C GPU@55C PLL@49C AO@46.5C Tboard@43C Tdiode@47.25C PMIC@100C thermal@48C VDD_IN 3387/3403 VDD_CPU 389/389 VDD_GPU 146/146 VDD_SOC 778/778 VDD_WIFI 0/0 VDD_DDR 1117/1123
RAM 931/7846MB (lfb 1578x4MB) CPU [0%@2031,0%@2036,0%@2035,0%@2035,0%@2035,0%@2035] EMC_FREQ 0%@1866 GR3D_FREQ 0%@1300 APE 150 MTS fg 0% bg 0% BCPU@49C MCPU@49C GPU@55C PLL@49C AO@47C Tboard@43C Tdiode@47.25C PMIC@100C thermal@48.2C VDD_IN 3387/3399 VDD_CPU 389/389 VDD_GPU 146/146 VDD_SOC 778/778 VDD_WIFI 0/0 VDD_DDR 1117/1121
RAM 931/7846MB (lfb 1578x4MB) CPU [0%@1997,0%@2034,0%@2035,0%@1996,0%@1997,0%@1996] EMC_FREQ 0%@1866 GR3D_FREQ 0%@1300 APE 150 MTS fg 0% bg 0% BCPU@49C MCPU@49C GPU@55C PLL@49C AO@46.5C Tboard@43C Tdiode@47.25C PMIC@100C thermal@48C VDD_IN 3387/3396 VDD_CPU 389/389 VDD_GPU 146/146 VDD_SOC 778/778 VDD_WIFI 0/0 VDD_DDR 1117/1120
^C
nvidia@tegra-ubuntu:~$ ./tegrastats 
RAM 931/7846MB (lfb 1578x4MB) CPU [0%@2035,0%@2035,0%@2035,0%@2035,0%@2035,0%@2035] BCPU@49C MCPU@49C GPU@55C PLL@49C AO@46.5C Tboard@43C Tdiode@47.25C PMIC@100C thermal@48.2C VDD_IN 3387/3387 VDD_CPU 389/389 VDD_GPU 146/146 VDD_SOC 778/778 VDD_WIFI 0/0 VDD_DDR 1117/1117
RAM 931/7846MB (lfb 1578x4MB) CPU [0%@2035,0%@2035,0%@2035,0%@2035,0%@2035,0%@2035] BCPU@49C MCPU@49C GPU@55C PLL@49C AO@46.5C Tboard@43C Tdiode@47.25C PMIC@100C thermal@48.2C VDD_IN 3387/3387 VDD_CPU 389/389 VDD_GPU 146/146 VDD_SOC 778/778 VDD_WIFI 0/0 VDD_DDR 1117/1117
RAM 931/7846MB (lfb 1578x4MB) CPU [0%@2035,0%@2035,0%@2035,0%@2035,0%@2035,0%@2035] BCPU@49C MCPU@49C GPU@55C PLL@49C AO@46.5C Tboard@43C Tdiode@47.25C PMIC@100C thermal@48.2C VDD_IN 3411/3395 VDD_CPU 389/389 VDD_GPU 146/146 VDD_SOC 778/778 VDD_WIFI 0/0 VDD_DDR 1117/1117
RAM 931/7846MB (lfb 1578x4MB) CPU [0%@2035,0%@2035,0%@2035,0%@2035,0%@2035,0%@2035] BCPU@49C MCPU@49C GPU@55C PLL@49C AO@47C Tboard@43C Tdiode@47.25C PMIC@100C thermal@48.2C VDD_IN 3387/3393 VDD_CPU 389/389 VDD_GPU 146/146 VDD_SOC 778/778 VDD_WIFI 0/0 VDD_DDR 1117/1117
RAM 931/7846MB (lfb 1578x4MB) CPU [0%@2035,0%@2035,0%@2035,0%@2035,0%@2035,0%@2035] BCPU@49C MCPU@49C GPU@55C PLL@49C AO@47C Tboard@43C Tdiode@47.25C PMIC@100C thermal@48C VDD_IN 3411/3396 VDD_CPU 389/389 VDD_GPU 146/146 VDD_SOC 778/778 VDD_WIFI 0/0 VDD_DDR 1117/1117

This issue can be verified by cat cpuinfo_cur_freq with root permission,
root@tegra-ubuntu:/sys/devices/system/cpu/cpufreq/policy0# cat cpuinfo_cur_freq
2036000
root@tegra-ubuntu:/sys/devices/system/cpu/cpufreq/policy0# cat cpuinfo_cur_freq
2012000
root@tegra-ubuntu:/sys/devices/system/cpu/cpufreq/policy0# cat cpuinfo_cur_freq
2012000
root@tegra-ubuntu:/sys/devices/system/cpu/cpufreq/policy0# cat cpuinfo_cur_freq
2007000
nvpmodel command show below.
nvidia@tegra-ubuntu:~$ sudo nvpmodel -q verbose
NV Power Mode: MAXN
0

After adjust Gonvernor=performance, this issue still there.
nvidia@tegra-ubuntu:~$ sudo ./jetson_clocks.sh --show
SOC family:tegra186 Machine:quill
Online CPUs: 0-5
CPU Cluster Switching: Disabled
cpu0: Gonvernor=performance MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
cpu1: Gonvernor=performance MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
cpu2: Gonvernor=performance MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
cpu3: Gonvernor=performance MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
cpu4: Gonvernor=performance MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
cpu5: Gonvernor=performance MinFreq=2035200 MaxFreq=2035200 CurrentFreq=2035200
GPU MinFreq=1300500000 MaxFreq=1300500000 CurrentFreq=1300500000
EMC MinFreq=40800000 MaxFreq=1866000000 CurrentFreq=1866000000 FreqOverride=1
Fan: speed=255

  1. As I know ./jetson_clocks.sh should make 6 CPUs to max performance, but seems it doesn’t work?
  2. Why sudo and without sudo ./jetson_clocks.sh, have different showing result?
  3. How can we force 6 CPUs to max performance with fix freq without any fluctuation?

I think the jetson_clock may need access some sys node.
It should also need to run the jetson_clock as supervisor mode.

@ShaneCCC
Ok got it.
How can we force 6 CPUs to max performance with fix freq without any fluctuation?

We can increase the compute delay time to get more stable value from ‘cpuinfo_cur_freq’ node.

e.g:

echo 5000 > /sys/kernel/debug/tegra_cpufreq/freq_compute_delay