Issues with CPU frequency after upgrade 23.01
-
Hi, I have been experiencing issues with CPU frequency speeds after upgrading to 23.01. Before upgrading, the Intel(R) Celeron(R) J6413 would sit at the 1.8GHz level but now it shows that its pushed to 2.7GHz constantly. I would think this is just a misrepresentation of the actual levels but my temperature for the CPU has gone up as well. I use to sit between 45-50C but now I am constantly running at 60C+. Also this router is very powerful for my network and I really don't push the CPU level past 10% even after the update.
Not sure what needs to be done to correct this. Any help would be appreciated.
-
Hmm that is odd. 1804MHz as max is weird, that should be 1801 to indicate turbo. And the current frequency should never show anything above 1801. Those values are only what the sysctls show though. So it could be the CPU actually reporting bad values or cpufreq miscalculating them.
What values were reported in 22.05?Steve
-
Just pitching in here.
A change that FreeBSD 14 brought was support for intel speed shift to control cpu power/performance. PowerD no longer seem to control that behavior anymore.
From what I can see your CPU supports that feature aswell.
If you have entries in your OS boot log showing: "hwpstate_intel0: <Intel Speed Shift> on cpu0" for each core, that is propably the case.Behavior with speed shift is controlled with the tunable "dev.hwpstate_intel.X.epp" (or sysctl dev.hwpstate_intel.X.epp=yy), where X is cpu core number starting with 0, and Y the value. 50 is default. 100 is aggressive powersave and 0 is aggressive performance. Remember to make an entry per core.
From my own limited testing 75-80 seem to correspond to powerD value of adaptive and 60-65 is roughly high-adaptive.The default value of 50 made my Jasper Lake CPU go to nearly full boost at all time, with higher thermals and power use to follow.
Hope it helps
-
Ah, that's good info thanks!
-
Thank you @modaeus for the response. I had to set it to 90 but it's now back to what it was before the update. The Overall temp has also decreased drastically as well. It took me a few to find where to these entries so I am going to include simpler instructions below incase someone gets lost.
To build off what @modaeus provided, you will need to go to System>Advanced>System Tunables. You can check and see if there are any entries that match the below Tunable Name but I did not have any in my list.
dev.hwpstate_intel.X.epp
If you don't find any entries matching, you can add one using the "+NEW" button.
Then enter an entry for each CPU core available. I had 4 so I entered 4 separate entries.
Tunables = dev.hwpstate_intel.X.epp (X is the Core Value)
Value = Set the threshold. Higher=Efficient, Lower=Performant
Description = Short description -
-
-
Facing the same issue. If I apply this fix, should
powerd
be turned off? -
It likely makes no difference if the CPU is actually using Speed Shift.
-
@ibbetsion I did not turn this off. From what I can understand, that function is no longer supported with BSD14
-
It still works for CPUs that have Speed Step but not Speed Shift. It seems more sensitive to usage in the high adaptive mode then it was in FreeBSD 12.
-
@csardoss said in Issues with CPU frequency after upgrade 23.01:
I did not turn this off. From what I can understand, that function is no longer supported with BSD14
On the other hand it might be also based on the CPU that is in usage.
-
Thanx Guyzz.
I had an i3-7100 that was mostly on 2398MHz (of 2400)
It wasn't actually running hot, the Hystou/Protecli chassis must be a nice cooler.
But no reason to waste power .....I ended up with these notes in my 23.01 install log
On 23.01 it seems like they changed the way to control the CPU speed (Speed Shift). This overrides the old SpeedStep , if the CPU is Speed Shift capable , and practically rendering the old pfSense PowerD unusable on those CPU's In order to control Speed Shift on the newer CPU's supporting it do the below: Check in the boot messages if the cpu supports Speed Shift. My Hystou Box dmesg output: It's an i3 7100 - with just 2 cores & HT , but it seems like the HT's are seen as cores. hwpstate_intel0: <Intel Speed Shift> on cpu0 hwpstate_intel1: <Intel Speed Shift> on cpu1 hwpstate_intel2: <Intel Speed Shift> on cpu2 hwpstate_intel3: <Intel Speed Shift> on cpu3 So I have to add Speed Shift control for that CPU. Go to - System --> Advanced --> System Tunables Add an entry per core you found via dmesg. NB. : I ended on a value of 75 instead the below 80 , and i disabled PowerD dev.hwpstate_intel.0.epp 80 CPU 0 Speed Shift Level dev.hwpstate_intel.1.epp 80 CPU 1 Speed Shift Level dev.hwpstate_intel.2.epp 80 CPU 2 Speed Shift Level dev.hwpstate_intel.3.epp 80 CPU 3 Speed Shift Level
Now it is idling at 597MHz , stepping up to 1798 / 2098 / 2397 when xferring a 5GB file via VPN to the summerhouse (200Mbit)
/Bingo
-
Hmm, interesting. That CPU is not shown as having speed shift but it looks like it's on gen 6 CPUs and above....
-
@stephenw10 Curiously, my N5105-based device which also shows having Speed Shift really didnāt like it. Even if I set it at 95 it would only shift between 1900 and 2080, and didnāt drop back to the usual 700s at all. Itās still working fine with the ānormalā PowerD utility, though, so itās not a major issue. shrug
-
Where were you checking that? From the sysctl output?
Seeing some quirkiness with the way the dashboard reports it here. Seems to only update a few times then stop.
-
@stephenw10 Hmm. Might check again, as I was looking at the web dashboard which always showed in a timely fashion on previous versions. Thanks!
-
Mmm, there are definite differences. Speed Shift can set each CPU differently and the dashboard only shows CPU0. That was fine when they were all locked at the same clock speed. Might need to update that.
-
@stephenw10 Ok, can confirm seeing shifting on the command line for the N5105. That needs settings around 90-100 to get anything close to the adaptive, though, otherwise itās sitting in the high 1000s most of the time and never adapts. If you set it around 75-80 it goes into turbo mode most of the time of 2.5GHz or so, which is overkill for these little fanless boxes.
-
@stephenw10 said in Issues with CPU frequency after upgrade 23.01:
Where were you checking that? From the sysctl output?
Seeing some quirkiness with the way the dashboard reports it here. Seems to only update a few times then stop.
How do you check that sysctl output (i hope it's a cli command).
I was grumbling a bit, over my settings.
The dashboard shows nice shifts , and idling around 597MHz.But my CPU Temperature doesn't really change (reflect the lower speed) ...
With out any modifications it was showing around 43C , and Dashboard showed cores spend a lot of time on 2+ GHz.Now at 597MHz i'm at a CPU temp of 41C w. peeks upwards 53C when it "boosts clock".
I'm quite happy w. a temp of 41..43C on a passively cooled box in the livingroom.
Was just wondering why a CPU shift of 1.4GHz downwards weren't showing more difference in temp.Actually even more thinking if it was not really running 2398MHz when PowerD was active, and the GUI showed that speed.
My Qotom i5 (22.05) was idling at around 1100..1600MHz , and had a about the same temp.
/Bingo
-
You might have higher level C states available already. In previous testing those tend to swamp any savings made by P states except at moderate CPU usage. Check 'sysctl dev.cpu.0'
You can disable Speed Shift and go back to using Powerd:
https://man.freebsd.org/cgi/man.cgi?query=hwpstate_intel#LOADER_TUNABLESOne interesting thing is that the speedshift driver can attach and enable on CPUs even when SpeedStep is disabled in the BIOS. So on systems where that can't be enabled it makes quite a difference. Like on this i3-6100t:
Steve
-
@stephenw10
How do you do that nice Temp Graph ??
Is that "external" via snmp or so ???I can pull some (last hour) cpu info from the Zabbix FreeBSD plugin, but not temp
/Bingo
-
Nope it's the Thermal Sensors graph from Status > Monitoring.
-
Dooh ...
That's a super nice feature - The monitoring stuff .... Was disabled on my Box.
Found it
Thnx
-
Yeah, that was added relatively recently. It can be very useful in diagnosing hardware issues.
-
-
-
-
I have just upgraded my Hystou from 23.01 to 23.05.
It was a succesfull upgrade (as usual)
Well ... besides the zabbix client package. But i have learnt that this one always have issues. So delete & reinstall after bootup.What i noticed though, was that the Hystou was again running quite hot ....
Behaving 100% like on 23.01 (first post).So i added the "tunables entries once more", and disabled powerD
And it seems to helped again.
Was i too impatient ??
I would ave expected 23.05 to have implemented the fix ..../Bingo
-
There is no additional tuning for SpeedShift in 23.05.
It will be enabled by support if your CPU supports it and the default values run the CPU faster/hotter than SpeedStep did on a system expected to run at low load.
Adding tunables to set the targets like that (or even higher numbers) will return the performance to SpeedStep like level. Except that SpeedShift is better in several ways still.
https://redmine.pfsense.org/issues/14047
Steve
-
So "In plain english" , 23.05 has the 23.01 issue fixed.
And i should delete my "tunables", and give it a try ??
Correct ?Should i enable PowerD , that i use to have enabled to activate the 23.05 speed/power adapt ?
Btw: The PR you listed above, has 23.09 as target
/Bingo
-
No, 23.05 behaves the same as 23.01 with regard to SpeedShift.
Enabling SpeedStep (powerd) does nothing unless you disable SpeedShift. You can do that by setting
hint.hwpstate_intel.0.disabled="1"
.Since SpeedShift is better that SpeedStep in every way except the default values (IMO). I recommend just setting the values as you have in both 23.01 and 23.05.
Steve
-
He..he
I just deleted my SpeedShift entries , as i thought the fix were in 23.05.
I'm reentering and setting to 75, as when it ran on 23.01
And keep PowerD disabled.Thnx
/Bingo
-
For reference I'm running those values at 80 on a test box I have here that supports SpeedShift.
-
I seem to remember that 80 was the "recommended value" in our last round of SpeedStep settings.
But i like the way my Hystou/Protecli behaves on 75.
/Bingo
-
-
I have an Atom C3558, I'm now using pfSense 2.7 but the FreeBSD version is obviously the same. The CPU was running most of the time at 800MHz, now is mostly stuck at the top speed of 2.2GHz and of course runs hotter. I don't know if it's an Heisenberg situation - just having the Dashboard open to check the CPU speed runs the CPU faster.
I have tried to set dev.hwpstate_intel.X.epp to 80 (X from 0 to 3) but it does not help. I'm not sure if the C3558 has SpeedShift, Intel ARK doesn't say it, nor I can find it in the boot log.
-
C3K doesn't have Speed Shift. Without the dashboard open try running:
[23.05.1-RELEASE][admin@6100-3.stevew.lan]/root: sysctl dev.cpu.0 dev.cpu.0.temperature: 55.0C dev.cpu.0.coretemp.throttle_log: 0 dev.cpu.0.coretemp.tjmax: 91.0C dev.cpu.0.coretemp.resolution: 1 dev.cpu.0.coretemp.delta: 37 dev.cpu.0.cx_method: C1/mwait/hwc C2/mwait/hwc dev.cpu.0.cx_usage_counters: 6940958 0 dev.cpu.0.cx_usage: 100.00% 0.00% last 20556us dev.cpu.0.cx_lowest: C1 dev.cpu.0.cx_supported: C1/1/1 C2/2/50 dev.cpu.0.freq_levels: 2200/0 2100/0 2000/0 1900/0 1800/0 1700/0 1600/0 1500/0 1400/0 1300/0 1200/0 1100/0 1000/0 900/0 800/0 dev.cpu.0.freq: 800 dev.cpu.0.%parent: acpi0 dev.cpu.0.%pnpinfo: _HID=none _UID=0 _CID=none dev.cpu.0.%location: handle=\_PR_.CPU0 dev.cpu.0.%driver: cpu dev.cpu.0.%desc: ACPI CPU
Check the available freq levels and current freq shown.
Steve
-
@LDS said in Issues with CPU frequency after upgrade 23.01:
I don't know if it's an Heisenberg situation - just having the Dashboard open to check the CPU speed runs the CPU faster.
I see this on my Protectli with a (non-Speed Shift?) J3160 with my busy Dashboard and
powerd
set to Hiadaptive. I never see the current CPU speed displayed at all on the Dashboard (since it's not displayed when at maximum), but if I leave the Dashboard and runsysctl dev.cpu.0.freq
at the command line I can see the frequency change. -
Tried via SSH - looks locked at 2200MHz:
dev.cpu.0.temperature: 40.0C dev.cpu.0.coretemp.throttle_log: 0 dev.cpu.0.coretemp.tjmax: 91.0C dev.cpu.0.coretemp.resolution: 1 dev.cpu.0.coretemp.delta: 51 dev.cpu.0.cx_method: C1/mwait/hwc C2/mwait/hwc dev.cpu.0.cx_usage_counters: 2960105 0 dev.cpu.0.cx_usage: 100.00% 0.00% last 4326us dev.cpu.0.cx_lowest: C1 dev.cpu.0.cx_supported: C1/1/1 C2/2/50 dev.cpu.0.freq_levels: 2200/0 2100/0 2000/0 1900/0 1800/0 1700/0 1600/0 1500/0 1400/0 1300/0 1200/0 1100/0 1000/0 900/0 800/0 dev.cpu.0.freq: 2200 dev.cpu.0.%parent: acpi0 dev.cpu.0.%pnpinfo: _HID=none _UID=0 _CID=none dev.cpu.0.%location: handle=\_PR_.CPU0 dev.cpu.0.%driver: cpu dev.cpu.0.%desc: ACPI CPU
I'll try to disable SpeedShift and reactivate PowerD and see what happens.
-
@LDS said in Issues with CPU frequency after upgrade 23.01:
reactivate PowerD
PowerD works fine on the 6100 which is that CPU.
-
Yeah you need powerd active to get lower CPU frequencies.
-
Setting hint.hwpstate_intel.0.disabled to 1 with PowerD returned to the old behaviour:
dev.cpu.0.temperature: 39.0C dev.cpu.0.coretemp.throttle_log: 0 dev.cpu.0.coretemp.tjmax: 91.0C dev.cpu.0.coretemp.resolution: 1 dev.cpu.0.coretemp.delta: 52 dev.cpu.0.cx_method: C1/mwait/hwc C2/mwait/hwc dev.cpu.0.cx_usage_counters: 16653 0 dev.cpu.0.cx_usage: 100.00% 0.00% last 17244us dev.cpu.0.cx_lowest: C1 dev.cpu.0.cx_supported: C1/1/1 C2/2/50 dev.cpu.0.freq_levels: 2200/0 2100/0 2000/0 1900/0 1800/0 1700/0 1600/0 1500/0 1400/0 1300/0 1200/0 1100/0 1000/0 900/0 800/0 dev.cpu.0.freq: 800 dev.cpu.0.%parent: acpi0 dev.cpu.0.%pnpinfo: _HID=none _UID=0 _CID=none dev.cpu.0.%location: handle=\_PR_.CPU0 dev.cpu.0.%driver: cpu dev.cpu.0.%desc: ACPI CPU
-
So, I added 4 cpu entries for my Intel i3-6100T as described here and seems to work well. My cpu drops down to 897MHz and temps are down to 30 degrees C. PowerD had no effect so I turned it off. I could not tell a difference between 75 and 80 in my low so I left it at 80. My low was never lower than 897MHz.
-
-
-