Skip to contentSkip to conversation

Schedutil scaling governor is missing time_in_state

DISCUSSION A L 2 participants 2 messages Jul 11, 2020 – Sep 3, 2020

lore
Share & tools
lore

A L

author
#0 lore raw

Hello,

I am testing the 'schedutil' scaling govenor.

So far it seems to give good results in terms of reduced thermals and energy consumption.

One difference compared to 'ondemand' that I noticed is that /sys/devices/system/cpu/cpu*/cpufreq/stats/time_in_state is never updated. It is always empty. This creates a problem for my munin graphs that log the average CPU frequency for each core.

Example with 'ondemand' cpu0/cpufreq/stats/time_in_state:3500000 3869872 cpu0/cpufreq/stats/time_in_state:2300000 581995 cpu0/cpufreq/stats/time_in_state:1600000 6895937 cpu0/cpufreq/stats/total_trans:1746213 cpu0/cpufreq/stats/trans_table:   From  :    To cpu0/cpufreq/stats/trans_table:         :   3500000   2300000   1600000 cpu0/cpufreq/stats/trans_table:  3500000:         0     49335     62476 cpu0/cpufreq/stats/trans_table:  2300000:     58219         0    756854 cpu0/cpufreq/stats/trans_table:  1600000:     53591    765738         0

Example with 'schedutil'
cpu3/cpufreq/stats/time_in_state:<empty>
cpu3/cpufreq/stats/total_trans:1751092
cpu3/cpufreq/stats/trans_table:<empty>

Is this a known problem or perhaps a design choice?

This is on kernel 5.7.8 on and AMD Athlon 3000G CPU using 'acpi_cpufreq' scaling_driver.

Anders

#1 lore raw
Quoted 20 lines · A L

Hello,

I am testing the 'schedutil' scaling govenor.

So far it seems to give good results in terms of reduced thermals and energy consumption.

One difference compared to 'ondemand' that I noticed is that /sys/devices/system/cpu/cpu*/cpufreq/stats/time_in_state is never updated. It is always empty. This creates a problem for my munin graphs that log the average CPU frequency for each core.

Example with 'ondemand'
cpu0/cpufreq/stats/time_in_state:3500000 3869872
cpu0/cpufreq/stats/time_in_state:2300000 581995
cpu0/cpufreq/stats/time_in_state:1600000 6895937
cpu0/cpufreq/stats/total_trans:1746213

cpu0/cpufreq/stats/trans_table:   From  :    To
cpu0/cpufreq/stats/trans_table:         :   3500000   2300000   1600000
cpu0/cpufreq/stats/trans_table:  3500000:         0     49335     62476
cpu0/cpufreq/stats/trans_table:  2300000:     58219         0    756854
cpu0/cpufreq/stats/trans_table:  1600000:     53591    765738         0
Quoted 8 lines

Example with 'schedutil'
cpu3/cpufreq/stats/time_in_state:<empty>
cpu3/cpufreq/stats/total_trans:1751092
cpu3/cpufreq/stats/trans_table:<empty>

Is this a known problem or perhaps a design choice?

This is on kernel 5.7.8 on and AMD Athlon 3000G CPU using 'acpi_cpufreq' scaling_driver.

With fast switching (done from within scheduler's context) we disable recording cpufreq stats and so
this information isn't available as such. total_trans shouldn't get updated as well, it should be a
stale value from the time when schedutil wasn't the governor.

Here is an attempt to fix it though.

http://lore.kernel.org/lkml/[email protected]