CPU C-states
-
Hello,
One of the homelab platforms I'm running XCP-ng on, is a AMD 7950X.
I recently noticed, that in Ubuntu Linux 24.04, PowerTop reports C-states C1-C3 (see screenshot).
However, in XCP-ng 8.3, the command « xenpm get-cpuidle-states » only reports C0 and C1.I've tried adding « cpuidle » to the Xen image boot parameters in Grub-efi.cfg which doesn't seem to make any difference to the output of the get-cpuidle-states command. Looking at the output of « xe host-dmesg » I am not sure what to look for; the lines referenced in an Xen documentation page do not seem to be present in the output on XCP-ng.
As this is a homelab project, I wish to reduce power consumption as much as is technically feasible and leverage the supported C-states (unless latency from switching to/out of C3 would be killing performance).
-
Power management is a fairly complex thing in Xen. Adding @TeddyAstie in the loop if you have ideas.
-
@FrankAtHome Here's output on one of my XCP 8.3 servers that shows C0 to C4:
# xenpm get-cpuidle-states 0 All C-states allowed cpu id : 0 total C-states : 5 idle time(ms) : 1854395327 C0 : transition [ 827366196] residency [ 26328742 ms] C1 : transition [ 464493378] residency [ 40172860 ms] C2 : transition [ 97685021] residency [ 43104018 ms] C3 : transition [ 13728657] residency [ 12613910 ms] C4 : transition [ 251459140] residency [ 1755416981 ms] pc2 : [ 462155589 ms] pc3 : [ 17985256 ms] pc6 : [ 781427622 ms] cc3 : [ 10502718 ms] cc6 : [ 1685502286 ms] -
ok that's interesting.
Which CPU is this on? AMD ? Intel ?
Did you specify any boot parameters in grub to unlock these C-States ? -
@FrankAtHome The server is a HP DL360 G8 Intel Xeon CPU E5-2680v2.
Same hardware/bios config as the other servers running XCP 8.2, so, nothing special setup. I'm not sure if it even has C5/C6 states available. It's an enterprise server, you don't want it to sleep.
Here's the output from a desktop HP Elitedesk 800 G3 Intel Core i7-7700 running XCP 8.3, again, nothing special setup. Now with more C-states!
# xenpm get-cpuidle-states 0 All C-states allowed cpu id : 0 total C-states : 7 idle time(ms) : 276484 C0 : transition [ 277556] residency [ 16869 ms] C1 : transition [ 197012] residency [ 9993 ms] C2 : transition [ 23581] residency [ 11105 ms] C3 : transition [ 2943] residency [ 2094 ms] C4 : transition [ 8525] residency [ 8576 ms] C5 : transition [ 5493] residency [ 17883 ms] C6 : transition [ 40001] residency [ 224993 ms] cc3 : [ 1946 ms] cc6 : [ 7945 ms] cc7 : [ 238808 ms] -
@FrankAtHome
I looked in to this as well a while back and the conclusion i came to, is that the newer AMD power management functions are not supported properly in the old kernel used by XCP-NG (And maybe xen?).
A lot of work seems to have been done in the 6.x kernel series on this.I get the same on my 7900 - only C0 and C1

I tried booting it on a Ubuntu 24.04 live cd and power consumption was easily 15% lower at idle. -
@redakula said in CPU C-states:
@FrankAtHome
I looked in to this as well a while back and the conclusion i came to, is that the newer AMD power management functions are not supported properly in the old kernel used by XCP-NG (And maybe xen?).
A lot of work seems to have been done in the 6.x kernel series on this.I get the same on my 7900 - only C0 and C1

I tried booting it on a Ubuntu 24.04 live cd and power consumption was easily 15% lower at idle.that sounds plausible as explanation.
I guess I will have to patiently await XCP-ng 6 branch and any improvements this may bring on AMD systems.
-
It's very likely in Xen itself since a part of the power management is done there. Another topic to bring during the Xen Winter Meetup @TeddyAstie

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login