Documentation
¶
Overview ¶
Package sst provides access to Intel Speed Select Technology (SST) features.
This file contains the legacy flat API, implemented as wrappers around the handle-based API.
Index ¶
- Constants
- func CheckPackageCpus(info *SstPackageInfo, cpus utils.IDSet) bool
- func ClosSetup(info *SstPackageInfo, clos int, closInfo *SstClosInfo) errordeprecated
- func ConfigureCP(info *SstPackageInfo, priority int, cpu2clos *ClosCPUSet) errordeprecated
- func DisableBF(pkgs ...int) errordeprecated
- func DisableCP(info *SstPackageInfo) errordeprecated
- func EnableBF(pkgs ...int) errordeprecated
- func EnableCP(info *SstPackageInfo) errordeprecated
- func GetCPUClosID(cpu utils.ID) (int, error)deprecated
- func GetPackageInfo(pkgs ...int) (map[int]*SstPackageInfo, error)deprecated
- func ResetCPConfig() errordeprecated
- func SetLogger(l *slog.Logger)
- func SstSupported() bool
- type BFInfo
- type BFStatus
- type CPPriorityType
- type CPStatus
- type ClosCPUSetdeprecated
- type ClosConfig
- type ClosStatus
- type PPStatus
- type Package
- func (p *Package) BFDisable() error
- func (p *Package) BFEnable() error
- func (p *Package) CPDisable() error
- func (p *Package) CPEnable() error
- func (p *Package) CPReset() error
- func (p *Package) CPSetPriorityType(priority CPPriorityType) error
- func (p *Package) ClosConfigure(clos int, config ClosConfig) error
- func (p *Package) GetPerfLevelInfo(level int) (map[utils.ID]*PerfLevelInfo, error)
- func (p *Package) GetStatus() (*PackageStatus, error)
- func (p *Package) ID() utils.ID
- func (p *Package) TFDisable() error
- func (p *Package) TFEnable() error
- type PackageStatus
- type PerfLevelInfo
- type Platform
- type PunitStatus
- type SstClosInfodeprecated
- type SstPackageInfodeprecated
- type TFBucketInfo
- type TFInfo
- type TFStatus
- type TRLFreqInfo
Constants ¶
const NumClos = 4
NumClos is the number of CLOS supported by SST-CP.
Deprecated: Use Init and Platform.ClosCount instead.
Variables ¶
This section is empty.
Functions ¶
func CheckPackageCpus ¶ added in v0.3.0
func CheckPackageCpus(info *SstPackageInfo, cpus utils.IDSet) bool
CheckPackageCpus checks that a list of CPUs belong to a given package.
Deprecated.
func ClosSetup
deprecated
added in
v0.3.0
func ClosSetup(info *SstPackageInfo, clos int, closInfo *SstClosInfo) error
ClosSetup stores the user-supplied CLOS configuration and writes it to hardware.
Deprecated: Use Init and Package.ClosConfigure instead.
func ConfigureCP
deprecated
added in
v0.3.0
func ConfigureCP(info *SstPackageInfo, priority int, cpu2clos *ClosCPUSet) error
ConfigureCP configures CPU-to-CLOS mappings and sets the CP priority type.
Deprecated: Use Init, Platform.ClosAssociate, and Package.CPSetPriorityType instead.
func DisableCP
deprecated
added in
v0.3.0
func DisableCP(info *SstPackageInfo) error
DisableCP disables SST-CP for a package. SST-TF must be disabled before calling this function.
Deprecated: Use Init and Package.CPDisable instead.
func EnableCP
deprecated
added in
v0.3.0
func EnableCP(info *SstPackageInfo) error
EnableCP enables SST-CP for a package. The priority type from info is used. info.ClosCPUInfo must be populated (e.g. via ConfigureCP) before calling.
Deprecated: Use Init and Package.CPEnable instead.
func GetCPUClosID
deprecated
func GetPackageInfo
deprecated
func GetPackageInfo(pkgs ...int) (map[int]*SstPackageInfo, error)
GetPackageInfo returns SST information for the given packages, or all packages if none are specified. Topology is read fresh on each call.
Deprecated: Use Init and Package.GetStatus instead.
func ResetCPConfig
deprecated
added in
v0.3.0
func ResetCPConfig() error
ResetCPConfig brings the system to a known state: all CLOSes reset to defaults and all CPUs assigned to CLOS 0.
Deprecated: Use Init and Package.CPReset instead.
func SetLogger ¶ added in v0.13.0
SetLogger sets the logger instance used by the package and its sub-packages.
func SstSupported ¶
func SstSupported() bool
SstSupported returns true if Intel Speed Select Technologies (SST) is supported by the system and can be interfaced via the Linux kernel device.
Types ¶
type BFInfo ¶ added in v0.13.0
type BFInfo struct {
Supported bool `json:"supported"`
HighPriorityBaseFreq int `json:"highPriorityBaseFreq,omitempty"` // MHz
LowPriorityBaseFreq int `json:"lowPriorityBaseFreq,omitempty"` // MHz
HighPriorityCPUs utils.IDSet `json:"highPriorityCPUs,omitempty"`
}
BFInfo contains SST-BF (Base Frequency) properties for one performance level.
type CPPriorityType ¶
type CPPriorityType uint8
CPPriorityType denotes the type of CLOS priority ordering used in SST-CP.
const ( Proportional CPPriorityType = 0 Ordered CPPriorityType = 1 )
func (CPPriorityType) Validate ¶ added in v0.13.0
func (p CPPriorityType) Validate() bool
Validate reports whether p is a recognised priority type.
type CPStatus ¶ added in v0.13.0
type CPStatus struct {
Supported bool `json:"supported"`
Enabled bool `json:"enabled"`
Priority CPPriorityType `json:"priority"`
}
CPStatus contains SST-CP (Core Power) state.
type ClosCPUSet
deprecated
added in
v0.3.0
type ClosConfig ¶ added in v0.13.0
type ClosConfig struct {
ProportionalPriority int `json:"proportionalPriority"`
MinFreq int `json:"minFreq"`
MaxFreq int `json:"maxFreq"`
// contains filtered or unexported fields
}
ClosConfig contains the configuration parameters of one CLOS of SST-CP.
type ClosStatus ¶ added in v0.13.0
type ClosStatus struct {
Config ClosConfig `json:"config"`
CPUs utils.IDSet `json:"cpus,omitempty"`
}
ClosStatus contains the configuration and CPU associations for one CLOS of SST-CP.
type PPStatus ¶ added in v0.13.0
type PPStatus struct {
Supported bool `json:"supported"`
Locked bool `json:"locked"`
Version int `json:"version"`
CurrentLevel int `json:"currentLevel"`
MaxLevel int `json:"maxLevel"`
Levels []int `json:"levels,omitempty"`
}
PPStatus contains SST-PP (Performance Profile) state.
type Package ¶ added in v0.13.0
type Package struct {
// contains filtered or unexported fields
}
Package provides SST operations for one CPU package.
func (*Package) BFEnable ¶ added in v0.13.0
BFEnable enables SST-BF for this package. NOTE: The caller should ensure that the sysfs cpufreq scaling limits of the affected CPUs allow higher base frequency on high-priority cores; see utils.GetCPUFreqValue, utils.SetCPUScalingMinFreq, and utils.SetCPUScalingMaxFreq.
func (*Package) CPReset ¶ added in v0.13.0
CPReset resets all CLOS parameters to defaults and associates all CPUs to CLOS 0.
func (*Package) CPSetPriorityType ¶ added in v0.13.0
func (p *Package) CPSetPriorityType(priority CPPriorityType) error
CPSetPriorityType sets the SST-CP priority type for this package.
func (*Package) ClosConfigure ¶ added in v0.13.0
func (p *Package) ClosConfigure(clos int, config ClosConfig) error
ClosConfigure configures CLOS parameters for this package.
func (*Package) GetPerfLevelInfo ¶ added in v0.13.0
GetPerfLevelInfo returns detailed SST-PP data for the given performance level, indexed by punit ID. Returns an error if the level is not available on any punit.
func (*Package) GetStatus ¶ added in v0.13.0
func (p *Package) GetStatus() (*PackageStatus, error)
GetStatus returns the current status of SST features.
type PackageStatus ¶ added in v0.13.0
type PackageStatus struct {
ID utils.ID `json:"id"`
Punits map[utils.ID]*PunitStatus `json:"punits"`
}
PackageStatus contains SST information for one package.
type PerfLevelInfo ¶ added in v0.13.0
type PerfLevelInfo struct {
CPUs utils.IDSet `json:"cpus"`
BF BFInfo `json:"bf"`
TF TFInfo `json:"tf"`
}
PerfLevelInfo contains detailed SST-PP information for one performance level.
type Platform ¶ added in v0.13.0
type Platform struct {
// contains filtered or unexported fields
}
Platform is the main entry point for the SST API.
func Init ¶ added in v0.13.0
Init initializes SST and returns a handle. The handle stores a snapshot of CPU topology of online CPUs at init time and is not updated on CPU hotplug.
func (*Platform) ClosAssociate ¶ added in v0.13.0
ClosAssociate associates CPUs to a CLOS.
func (*Platform) ClosCount ¶ added in v0.13.0
ClosCount returns the number of CLOS supported by the platform.
func (*Platform) GetCPUClosID ¶ added in v0.13.0
GetCPUClosID returns the SST-CP CLOS id for a CPU.
type PunitStatus ¶ added in v0.13.0
type PunitStatus struct {
CPUs utils.IDSet `json:"cpus"`
PP PPStatus `json:"pp"`
BF BFStatus `json:"bf"`
TF TFStatus `json:"tf"`
CP CPStatus `json:"cp"`
Clos []ClosStatus `json:"clos,omitempty"`
}
PunitStatus contains SST information for one power domain (punit) within a package.
type SstPackageInfo
deprecated
type SstPackageInfo struct {
// PP (Performance Profile) info
PPSupported bool
PPLocked bool
PPVersion int
PPCurrentLevel int
PPMaxLevel int
// Information about SST features at the currently active PP level
CPSupported bool
CPEnabled bool
CPPriority CPPriorityType
BFSupported bool
BFEnabled bool
BFCores utils.IDSet
TFSupported bool
TFEnabled bool
ClosInfo [NumClos]SstClosInfo
ClosCPUInfo ClosCPUSet
// contains filtered or unexported fields
}
SstPackageInfo contains status of Intel Speed Select Technologies (SST) for one CPU package, used by the legacy API.
Deprecated: Use Init and Package.GetStatus instead.
type TFBucketInfo ¶ added in v0.13.0
type TFBucketInfo struct {
ID int `json:"id"`
HighPriorityCoreCount int `json:"highPriorityCoreCount"`
// MaxFreqs contains maximum turbo frequency for each TRL level.
MaxFreqs []TRLFreqInfo `json:"maxFreqs"`
}
TFBucketInfo holds SST-TF high-priority bucket data for one performance level. Empty buckets (core count == 0) are omitted.
type TFInfo ¶ added in v0.13.0
type TFInfo struct {
Supported bool `json:"supported"`
// LPClipFreqs contains the low-priority core frequency limits for each TRL level.
LPClipFreqs []TRLFreqInfo `json:"lpClipFreqs,omitempty"`
// Buckets contain info about TF buckets.
Buckets []TFBucketInfo `json:"buckets,omitempty"`
}
TFInfo contains SST-TF (Turbo Frequency) properties for one performance level.
Buckets group CPUs into high-priority sets by core count. Each bucket defines how many cores receive elevated turbo frequencies and the maximum frequency allowed at each TRL level for the priority cores.
TRL (Turbo Ratio Limit) are limits for certain instruction-set workload classes (e.g. SSE, AVX2, AVX-512).
type TRLFreqInfo ¶ added in v0.13.0
TRLFreqInfo holds a TRL level ID and its associated frequency in MHz.