When SMT is disabled Intel CPU, the average and the min cpu frequencies are incorrect.
What do you mean by incorrect? Is it stuck on the same value or is it different than cat /proc/cpuinfo | grep "MHz"? Which governor are you using? You can also compare the average results with watch -n1 "cat /proc/cpuinfo | grep 'MHz' | cut -d: -f2 | awk '{a+=\$1+0} END{print a/NR}'"
(In reply to Andre Miranda from comment #1) > What do you mean by incorrect? Is it stuck on the same value or is it > different than cat /proc/cpuinfo | grep "MHz"? > Which governor are you using? > > You can also compare the average results with watch -n1 "cat /proc/cpuinfo | > grep 'MHz' | cut -d: -f2 | awk '{a+=\$1+0} END{print a/NR}'" My laptop has 8 logical cores. When Hyperthreading is disabled, only 4 physical cores have frequencies. /proc/cpuinfo is correctly showing 4 cpu info. But apparently the plugin didn't get freq from /proc/cpuinfo. There are 4 disabled cores which have 0 freq. And they are being calculated for avg and min freq.
You're right, /proc/cpuinfo is not the first place cpufreq-plugin looks for core count. Please check the output of find /sys/devices/system/cpu -maxdepth 1 -name "cpu[0-9]*" when HT is disabled. Sorry, but the two machines I have around are Core i5, no way to test that.
(In reply to Andre Miranda from comment #3) > You're right, /proc/cpuinfo is not the first place cpufreq-plugin looks for > core count. > Please check the output of find /sys/devices/system/cpu -maxdepth 1 -name > "cpu[0-9]*" when HT is disabled. > Sorry, but the two machines I have around are Core i5, no way to test that. That gives me 8 cpus when HT is disabled. 0-3 are online and 4-7 are offline.
I was able to simulating this by toggle cpus with: # echo 0 > /sys/devices/system/cpu/cpu1/online # echo 0 > /sys/devices/system/cpu/cpu2/online # echo 0 > /sys/devices/system/cpu/cpu3/online This enhancement is present on this branch: https://git.xfce.org/users/andre/xfce4-cpufreq-plugin/ It would be awesome if you are able to test before I push to master.
Yep. I tested it using s-tui to stress my laptop. It's displaying the right avg freq. Problem solved. Thank you. Although, it's a bit hard to tell from watch -n1 'cat /proc/cpuinfo | grep "MHz"' when idle. They are not quite the same. But generally it's good enough.
Andre Miranda referenced this bugreport in commit 6c34eee3c07529529900230d32476ac840be11af Check if each cpu is online (Bug #14641) https://git.xfce.org/panel-plugins/xfce4-cpufreq-plugin/commit?id=6c34eee3c07529529900230d32476ac840be11af
I think the following script should yield a result similar to cpufreq-plugin, since it reads from the same source: cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq | awk '{printf "%3.2f\n", $0/1000}' | jq -s add/length I my case the results vary a lot, even if you run watch somewhat synchronized to cpufreq update interval, most of the readings will diverge. Closing this bug, the fix will be available in 1.2.1.