Re: AMD, CPPC, etc
- Reply: Warner Losh : "Re: AMD, CPPC, etc"
- In reply to: Adrian Chadd : "Re: AMD, CPPC, etc"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 25 May 2026 11:47:45 UTC
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