Is it possible to enable deeper c-states?

Started by Siarap, April 29, 2024, 06:05:48 AM

Previous topic - Next topic
Is it posible to enable deeper c-states than C3 in opnsense? My opnsense detects only C3 as deepest c-state. Is it something blocked? I think my intel i5-6500 supports deeper c-states. But maybe this is blocked in bios. My opnsense instance is installed on Hewlett Packard elite desk 800 g2 sff. Im currently using C3 c-state. And my elite desk power draw is about 18 watts when idle.

sysctl hw.acpi.cpu.cx_lowest=Cmax

if you CPU supports it, you might also look at
sysctl dev.hwpstate_intel.<cpu>.epp=[0-100]

https://man.freebsd.org/cgi/man.cgi?query=hwpstate_intel&sektion=4&format=html

I also found the most power savings by ensuring ASPM is enabled in BIOS for PCI devices (though if it makes things unstable, you often have to revert this)
pciconf -lcv | grep ASPM

April 29, 2024, 10:40:53 PM #2 Last Edit: May 01, 2024, 06:23:29 AM by Siarap
root@router:~ # pciconf -lcv | grep ASPM
                 link x4(x16) speed 5.0(8.0) ASPM L1(L0s/L1)
                 link x0(x1) speed 0.0(8.0) ASPM L0s/L1(L0s/L1)
                 link x0(x1) speed 0.0(8.0) ASPM L0s/L1(L0s/L1)
                 link x0(x4) speed 0.0(8.0) ASPM L0s/L1(L0s/L1)
                 link x4(x4) speed 5.0(5.0) ASPM L1(L0s/L1)
                 link x4(x4) speed 5.0(5.0) ASPM L1(L0s/L1)

hwpstate disabled for lower power draw
sysctl dev.hwpstate_intel.<cpu>.epp=[0-100]
changes nothing even on 100 value. When hwpstate is enabled processor wont drop clocks lower than 1593mhz. After disabling it it drops clocks to 800mhz when idle.

after tunnable sysctl hw.acpi.cpu.cx_lowest=Cmaxi get this:

root@router:~ # sysctl dev.cpu | grep cx
dev.cpu.3.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc
dev.cpu.3.cx_usage_counters: 440 60 3436
dev.cpu.3.cx_usage: 11.17% 1.52% 87.29% last 177us
dev.cpu.3.cx_lowest: C8
dev.cpu.3.cx_supported: C1/1/1 C2/2/151 C3/3/256
dev.cpu.2.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc
dev.cpu.2.cx_usage_counters: 400 100 3017
dev.cpu.2.cx_usage: 11.42% 2.84% 85.73% last 139us
dev.cpu.2.cx_lowest: C8
dev.cpu.2.cx_supported: C1/1/1 C2/2/151 C3/3/256
dev.cpu.1.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc
dev.cpu.1.cx_usage_counters: 570 28 3431
dev.cpu.1.cx_usage: 14.14% 0.69% 85.15% last 133us
dev.cpu.1.cx_lowest: C8
dev.cpu.1.cx_supported: C1/1/1 C2/2/151 C3/3/256
dev.cpu.0.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc
dev.cpu.0.cx_usage_counters: 4008 13899 35455
dev.cpu.0.cx_usage: 7.51% 26.04% 66.44% last 448us
dev.cpu.0.cx_lowest: C8
dev.cpu.0.cx_supported: C1/1/1 C2/2/151 C3/3/256


lowest is c8 but supported lowest c3 i dont know why.
Opnsense not supporting c-states deeper than C3?