Documentation
¶
Overview ¶
Package types defines the internal class-definition struct used by the cpuclass writers (cpufreq, cpuidle, uncorefreq). It exists as a separate package so each writer can depend on the same struct without depending on the public cpuclass API or on the soon-to-be-deprecated control/cpu config package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllocationHints ¶
type AllocationHints struct {
Prefer []CpuPreference
Avoid []CpuPreference
}
AllocationHints carries technology-agnostic placement preferences for an upcoming allocation. Both slices are ordered by descending priority.
type AllocationIntent ¶
type AllocationIntent struct {
// ClassName is the cpuClass the upcoming allocation will use.
ClassName string
// CurrentCpus are the CPUs the caller already owns.
CurrentCpus cpuset.CPUSet
// FreeCpus are the CPUs the allocation can pick from. Prefer
// hints never contain CPUs outside this set.
FreeCpus cpuset.CPUSet
// RequestedCount is the number of CPUs the allocation wants.
// A negative count means releasing that many CPUs from
// CurrentCpus. Zero is reserved and unspecified.
RequestedCount int
}
AllocationIntent describes an upcoming CPU allocation for which the caller wants placement preferences. Lives here so internal helpers (e.g. pct) can implement Hints without depending on the public cpuclass package.
type CPUSet ¶
CPUSet aliases cpuset.CPUSet for callers that want to refer to it via this package without re-importing pkg/utils/cpuset.
type ClassDef ¶
type ClassDef struct {
MinFreq uint
MaxFreq uint
EnergyPerformancePreference uint
UncoreMinFreq uint
UncoreMaxFreq uint
FreqGovernor string
DisabledCstates []string
}
ClassDef is the resolved, platform-aware definition of a CPU class as consumed by the writers. All frequency fields are in kHz; zero means "no enforcement". Symbolic frequencies in the user-facing configuration are resolved before being placed into a ClassDef.
type CpuPreference ¶
CpuPreference is a named, priority-ordered list of candidate CPU sets carrying a single placement preference (prefer or avoid depending on the slice it appears in). Cpus lists candidate sets ordered from most to least preferred: an allocation should honor the first candidate it can and ignore others.