Date: Mon, 25 May 2026 13:47:45 +0200 From: Olivier Certner <olce@freebsd.org> To: Chris Torek <chris.torek@gmail.com>, Adrian Chadd <adrian@freebsd.org> Cc: freebsd-current <freebsd-current@freebsd.org>, ShengYi Hung <aokblast@freebsd.org> Subject: Re: AMD, CPPC, etc Message-ID: <1978836.vR5SVPPSqJ@ravel> In-Reply-To: <CAJ-Vmont9jS-VqKj%2B02DCDP_Eb=UdWqPGWKrBpTn74_WfXHFjA@mail.gmail.com> References: <CAPx1GvfaDdmj0vkzzinyhGm2mQRKgmOh3fpNXo-cgznoujVY-Q@mail.gmail.com> <CAJ-Vmont9jS-VqKj%2B02DCDP_Eb=UdWqPGWKrBpTn74_WfXHFjA@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] Hi, > > Commit 80d32a6b1d73 (hwpstate_amd(4): CPPC: Switch the default to > > maximum performance) cranks my 7950-based system from its 90-to-100 > > watt idle draw up to 150+ watts. If I set > > dev.hwpstate_amd.0.desired_performance=0, it goes back down, so this > > isn't too big a deal, but I see that powerd has no idea about using > > the CPPC control knobs. powerd(8) still does not know about these CPPC controls. We have plans to change it. Actually, we wanted to produce a PoC at AsiaBSDCan two months ago, but this was thwarted by illness there... See pointers below. I won't have time to devote to this until the hackathon after BSDCan. I don't know about ShengYi, it seems he's busy with other topics. > Would you please file a PR about powerd and CPPC control knobs? That would be a good idea, to better keep track of past discussion and what's happening. Some pointers to previous messages/discussions: - https://lists.freebsd.org/archives/cu/2026-February/009918.html - The end of https://lists.freebsd.org/archives/freebsd-hackers/2026-February/005774.html - https://reviews.freebsd.org/D55253 > I'd much prefer that powerd bump the CPU frequency up to the highest (eg what it does on ARM, > powerpc64 p8/p9 boxes) versus expecting the kernel to configure that > at boot. The commit mentioned above ("hwpstate_amd(4): CPPC: Switch the default to maximum performance") was done to fix the regression caused by enabling CPPC by default in hwpstate_amd(4) (which perhaps we did prematurely). hwpstate_amd(4) has been our driver for regular P-states from the start (before growing the CPPC support), and by default it selects the state with maximum frequency, which we have wanted to reproduce. This is different from what the hwpstate_intel(4) driver, which only supports CPPC for Intel processors (and not P states), does, which is to keep Intel's initialization value for EPP (as mentioned just above), i.e., some balanced setting. I have not checked whether Intel implements CPPC on its desktop processors. Going further, I have been considering changing hwpstate_amd(4)'s defaults (maximum performance => some balanced setting (which itself is not that well-defined for CPPC both in theory and apparently in practice on AMD processors)) if running on a laptop (see last comment of D55253 mentioned above). The CPU model above (7950) is a desktop one, and not setting such a CPU to its maximum performance by default a priori appears to me as a much more controversial change. I guess people do not run powerd(8) on desktop machines (and maybe a number of them do not run powerd(8) either on not too old Intel laptops due to hwpstate_intel(4)). We might consider switching to a model where powerd(8) is always run by default, but that probably requires significant work on powerd(8) to make it much smarter. On a related note, going forward, we might want to move part of powerd(8)'s logic into the kernel. How does CPU frequency selection and default values work on powerpc64/ARM? Regards. -- Olivier Certner [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmoUNuEACgkQjKEwQJce JiezYA/9E53b7EaDzJZ29eexUB3NGfrF8DS7/2/HphlERnxo+/9/SdUYmB2OeKGB RJhcii6o9NmaiD8bUukg8g6iz7z3bo1qOn36ckVtjCvWxOAYaMfdA8xUJwBbR2eX fujmog55KfS5Z5Qt5pfMJNkq7RlpxR26u/fh2uigu8pghuG39lL5feQT6zMjKKDr WMDlmVRWe2Plu6C4rHoRUwSTns9l/GsfJks2QzilofoIqIXoTXQWi7cU+G9hHKOu gFNSkKkaPwlfLqrb0OP4NULlEvkeup+Cfm4Kuby7j3+p7yabr8mlEXWJwf12mM+g WyhFmu8YaqTmlxCfdCGjHqGrz8K+ZZSOUlz6+nz87WPvDQwNztfbjrPUFiWES6Ge HyxZS6Vp6eiVFOj7keRyQJ0TG2XMFLtlyDWSabs0u81WWGobWG9q0fb27lI/EaaM dRYLIKszSQYjkS8dTrr5RK7Rhhq2QWRf9niMAiB8JzxMhm/LWL/3bJaQKsrYKIHs 93ACYUnrylXgW0pPCoVpu2dTDDm3b2rkYHwkjwTLIIHUpapxqhKCqaZmTYu0kb33 Rfis5SaMjZFdiTQ30iqXFw/u3qwmPrEI/1RrMP1Ri35bTxbj2I/4GjI1PbVz7TBO OJFCCSxxoh/1Uxf54X8iqZXhVybK9vjmnsEiBZF9kkXkqXSYbYE= =1IMP -----END PGP SIGNATURE-----home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1978836.vR5SVPPSqJ>
