Page MenuHomeFreeBSD

hwpstate_amd(4): CPPC: Switch the default to maximum performance
Needs ReviewPublic

Authored by olce on Wed, Feb 11, 8:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 14, 6:06 AM
Unknown Object (File)
Fri, Feb 13, 4:18 AM
Unknown Object (File)
Thu, Feb 12, 5:32 PM
Unknown Object (File)
Thu, Feb 12, 4:33 AM
Unknown Object (File)
Wed, Feb 11, 11:08 PM
Unknown Object (File)
Wed, Feb 11, 10:32 PM
Subscribers

Details

Summary

Set controls to maximum performance to avoid regressions now that CPPC
is activated by default and to match what the P-state support does.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70627
Build 67510: arc lint + arc unit

Event Timeline

olce requested review of this revision.Wed, Feb 11, 8:51 PM

Let me explain the context for this, so that we can discuss if this is the best solution or if we should find something else, both short term and longer term.

hwpstate_amd(4) is compiled-in in GENERIC by default (as part of cpufreq). Contrary to hwpstate_intel(4), this driver not only contains the new CPPC support, it also supports the regular, fixed P-states.

So far, we have chosen to enable CPPC support by default when supported by the processor. As PR 292615 has shown, this can cause a performance regression (cracauer@'s case), and does make powerd(8) ineffective (cy@'s case; apparently he found acceptable settings of CPPC knobs for his use case, with possibly better hardware reactivity than powerd(8)'s).

To add to the equation, once CPPC support is enabled, it cannot be disabled (except by a processor reset).

For the short-term:

  • Either we keep CPPC support enabled by default, and then, in order to avoid performance regressions but also to be consistent with all other cpufreq drivers except hwpstate_intel(4), I push this revision, that sets the knobs by default to maximum performance.
  • Or we disable CPPC support by default, if we find making powerd(8) stop working on processors with CPPC support out-of-the-box is not acceptable, and then I may or may not push this change (I'd be inclined to push it anyway). Note that hwpstate_intel(4) is enabled by default on supported processors, making powerd(8) useless on these, so there is a precedent in favor of enabling CPPC by default.

Longer term, widening the perspective:

  • We need a manual page.
  • We should change the default tuning for hwpstate_intel(4) accordingly (i.e., start with maximum performance), even if this is a default behavior change.
  • hwpstate_intel(4) should be modified to match hwpstate_amd(4), with EPP values between 0 and 255 (even if that breaks compatibility; today the scale is 0 to 100), and addition of the other performance knobs (and debugging output; basically all my recent work on hwpstate_amd(4)).
  • Teach powerd(8) about CPPC controls and how to use them instead of trying to set frequencies.
  • Maybe split hwpstate_amd(4) in 2 drivers (one for regular P-state, the other for CPPC), but then which one attaches should be handled in some way, probably via the default driver machinery priorities (instead of the hack hwpstate_intel(4) uses vis-à-vis est(4)). Doing this, among others, would allow to disable CPPC through the usual hint mechanism instead of the ad-hoc knob machdep.hwpstate_amd_cppc_enable.