diff options
| author | Andre Silva <andasilv@amd.com> | 2026-07-28 14:50:54 +0000 |
|---|---|---|
| committer | Mitchell Horne <mhorne@FreeBSD.org> | 2026-07-28 14:54:21 +0000 |
| commit | a99d04f39dab0eac88eb4f5af425aceaf9238207 (patch) | |
| tree | ffce88ea8195341dbdb8b846f6bfc5364c24c160 /lib/isc | |
| parent | 77404ee1e99d502345a1f9356b05c09abfbde831 (diff) | |
hwpmc: add RAPL energy-counter class (AMD + Intel)
Add hwpmc_rapl.c/.h implementing PMC_CLASS_RAPL, a read-only
system-scope class modeled on TSC and wired into x86 AMD and Intel MD
init. A per-vendor MSR table covers AMD/Hygon and Intel; energy is
reported in microjoules, with the Intel server 2^-16 J DRAM unit
handled and 32-bit wraps recovered into a 64-bit accumulator.
The overflow guard follows the PMC lifetime: armed on the first
allocated PMC, callout_drain()d on the last release, and each tick only
rendezvouses CPUs holding one. Per-CPU spin locks guard the accumulator
against torn reads on i386. PMC_CAP_DOMWIDE lets pmcstat(8) allocate
one counter per NUMA domain instead of per CPU.
Reviewed by: mhorne, Ali Mashtizadeh <ali@mashtizadeh.com>
Sponsored by: AMD
Differential Revision: https://reviews.freebsd.org/D58028
Diffstat (limited to 'lib/isc')
0 files changed, 0 insertions, 0 deletions
