Page MenuHomeFreeBSD

hwpstate{_amd,intel}(4): Move common knobs to a separate file
ClosedPublic

Authored by olce on Jan 5 2026, 3:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Feb 3, 3:27 PM
Unknown Object (File)
Fri, Jan 30, 3:24 PM
Unknown Object (File)
Mon, Jan 26, 11:27 AM
Unknown Object (File)
Sat, Jan 24, 1:11 AM
Unknown Object (File)
Tue, Jan 20, 5:25 AM
Unknown Object (File)
Sun, Jan 18, 1:13 AM
Unknown Object (File)
Tue, Jan 13, 9:48 AM
Unknown Object (File)
Mon, Jan 12, 9:19 PM

Details

Summary

This is to avoid conflict for 'machdep.hwpstate_pkg_ctrl' for the time
being (I expect to remove it for hwpstate_amd(4) at some point), but may
prove useful for other knobs, such as 'debug.hwpstate_verbose' (which is
currently not used in Intel's driver).

Fixes: 3e6e4e4a0d42 ("hwpstate: add CPPC support for pstate driver on AMD")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/x86/cpufreq/hwpstate_amd.c
365

This definitely needs some comment explaining why we register the sysctls this way.

sys/x86/cpufreq/hwpstate_amd.c
366–376

While it does not hurt per se, I would not move the above knobs here, as they do not exist in the Intel driver and my plan is to remove machdep.hwpstate_pkg_ctrl both here and in the Intel driver in favor of a common knob under dev.hwpstate_* to set all cores' EPP, which could later lead to removing hwpstate_modevent().

olce edited reviewers, added: aokblast; removed: olce.

"Simpler" approach with some common file holding the common sysctl knobs. As said, I anticipate that machdep.hwpstate_pkg_ctrl will be removed from hwpstate_amd, but debug.hwpstate_verbose will probably stay and start to be used in hwpstate_intel as well. There are other knobs in hwpstate_amd that might become relevant for Intel too, but I haven't spent too much time on them, they could be moved later.

olce retitled this revision from hwpstate: Use dynamic sysctl initialization to hwpstate{_amd,intel}(4): Move common knobs to a separate file.
olce edited the summary of this revision. (Show Details)

New approach

sys/sys/sysctl.h
38–40 ↗(On Diff #171324)

Oops, that part to be committed separately (and could be changed if someone objects to including sys/types.h from sys/sysctl.h).

Seems reasonable to me

sys/conf/files.x86
344

should sort in alpha order

olce marked an inline comment as done.Fri, Feb 6, 3:13 PM
This revision was not accepted when it landed; it landed in state Needs Review.Fri, Feb 6, 4:23 PM
This revision was automatically updated to reflect the committed changes.