Supported CPU C-States



  • Hi guys,

    My current pfsense setup is based on an Intel Celeron G3930 (Kaby Lake).
    When using any Linux Distro like Debian 9, Ubuntu 18.x, etc., the deepest CPU C-State C8 (also Package C8) will be used when System is in idle state.

    When checking the status in pfsense, seems to be the deepest available C-State is C3:

    dev.cpu.0.cx_supported: C1/1/1 C2/2/151 C3/3/256

    Does anyone know if it's possible to get the CPU C-States C3+ available as well?

    Thanks,
    Philipp


  • Netgate Administrator

    Hmm, not sure I've ever seen C-states higher (lower?) than C3 in FreeBSD. Though last time I played around with that stuff it made immeasurably small difference to anything enabling further states.

    Is it actually using the states you have currently? What does dev.cpu.0.cx_usage show?

    What are you actually hoping to achieve by enabling further states?

    Steve



  • Hi Steve,

    As shown below, C3 state will be currently used:

    sysctl dev.cpu |grep cx
    dev.cpu.1.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc
    dev.cpu.1.cx_usage_counters: 1513873 2478992 9943845
    dev.cpu.1.cx_usage: 10.86% 17.78% 71.35% last 3386us
    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: 83485812 108776041 11098
    dev.cpu.0.cx_usage: 43.42% 56.57% 0.00% last 102us
    dev.cpu.0.cx_lowest: C8
    dev.cpu.0.cx_supported: C1/1/1 C2/2/151 C3/3/256

    Seems to be the C3 state will be used more on the second cpu core (cpu.1):

    dev.cpu.0.cx_usage: 43.42% 56.57% 0.00% last 102us
    dev.cpu.1.cx_usage: 10.86% 17.78% 71.35% last 3386us

    Concerning the lowest state C8, I set the following in > System> Advanced > System Tunables:

    dev.cpu.0.cx_lowest > C8
    dev.cpu.1.cx_lowest > C8
    hw.acpi.cpu.cx_lowest > C8

    The lowest idle power consumption is currently 11.2W (measured with a power meter).
    If the same system is running on Debian 9, the lowest idle power consumption is below 8W.


  • Netgate Administrator

    That additional power consumption may not be the CPU of course. 3W seems like a lot for states below C3 which is already very low power. As I said I'm not sure I've seen lower C states reported by FreeBSD. It might not be possible.

    You have enabled powerd I assume? Though the provided P-states are swamped by C-state reductions I found.

    This page, though now a bit dated, was very useful when I was poking at this stuff.
    https://wiki.freebsd.org/TuningPowerConsumption

    Steve


Log in to reply