sst

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 16 Imported by: 4

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

View Source
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 DisableBF deprecated added in v0.3.0

func DisableBF(pkgs ...int) error

DisableBF disables SST-BF and restores CPU frequency scaling minimums.

Deprecated: Use Init and Package.BFDisable 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 EnableBF deprecated added in v0.3.0

func EnableBF(pkgs ...int) error

EnableBF enables SST-BF and sets up CPU frequency scaling accordingly.

Deprecated: Use Init and Package.BFEnable 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 GetCPUClosID(cpu utils.ID) (int, error)

GetCPUClosID returns the SST-CP CLOS id that a CPU is associated with.

Deprecated: Use Init and Platform.GetCPUClosID instead.

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

func SetLogger(l *slog.Logger)

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 BFStatus added in v0.13.0

type BFStatus struct {
	Supported bool `json:"supported"`
	Enabled   bool `json:"enabled"`
}

BFStatus contains SST-BF (Base Frequency) state.

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 ClosCPUSet map[int]utils.IDSet

ClosCPUSet contains a mapping from CLOS id to a set of CPU ids.

Deprecated: CPU associations are now in ClosStatus.CPUs.

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) BFDisable added in v0.13.0

func (p *Package) BFDisable() error

BFDisable disables SST-BF for this package.

func (*Package) BFEnable added in v0.13.0

func (p *Package) BFEnable() error

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) CPDisable added in v0.13.0

func (p *Package) CPDisable() error

CPDisable disables SST-CP for this package.

func (*Package) CPEnable added in v0.13.0

func (p *Package) CPEnable() error

CPEnable enables SST-CP for this package.

func (*Package) CPReset added in v0.13.0

func (p *Package) CPReset() error

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

func (p *Package) GetPerfLevelInfo(level int) (map[utils.ID]*PerfLevelInfo, error)

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.

func (*Package) ID added in v0.13.0

func (p *Package) ID() utils.ID

ID returns the package ID.

func (*Package) TFDisable added in v0.13.0

func (p *Package) TFDisable() error

TFDisable disables SST-TF for this package.

func (*Package) TFEnable added in v0.13.0

func (p *Package) TFEnable() error

TFEnable enables SST-TF for this package.

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

func Init() (*Platform, error)

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

func (h *Platform) ClosAssociate(clos int, cpus utils.IDSet) error

ClosAssociate associates CPUs to a CLOS.

func (*Platform) ClosCount added in v0.13.0

func (h *Platform) ClosCount() int

ClosCount returns the number of CLOS supported by the platform.

func (*Platform) GetCPUClosID added in v0.13.0

func (h *Platform) GetCPUClosID(cpu utils.ID) (int, error)

GetCPUClosID returns the SST-CP CLOS id for a CPU.

func (*Platform) Package added in v0.13.0

func (h *Platform) Package(pkgID int) (*Package, bool)

Package returns a PackageHandle for the given package ID.

func (*Platform) Packages added in v0.13.0

func (h *Platform) Packages() []*Package

Packages returns PackageHandles for all detected packages, sorted by package ID.

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 SstClosInfo deprecated

type SstClosInfo struct {
	EPP                  int
	ProportionalPriority int
	MinFreq              int
	MaxFreq              int
	DesiredFreq          int
}

SstClosInfo contains parameters of one CLOS of SST-CP.

Deprecated: Use ClosConfig and ClosStatus instead.

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 TFStatus added in v0.13.0

type TFStatus struct {
	Supported bool `json:"supported"`
	Enabled   bool `json:"enabled"`
}

TFStatus contains SST-TF (Turbo Frequency) state.

type TRLFreqInfo added in v0.13.0

type TRLFreqInfo struct {
	ID   int `json:"id"`
	Freq int `json:"freq"` // MHz
}

TRLFreqInfo holds a TRL level ID and its associated frequency in MHz.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL