types

package
v0.13.0 Latest Latest
Warning

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

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

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      string
	CurrentCpus    cpuset.CPUSet
	FreeCpus       cpuset.CPUSet
	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

type CPUSet = cpuset.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.

func (ClassDef) Equal

func (c ClassDef) Equal(other ClassDef) bool

Equal reports whether two ClassDef values describe identical per-CPU enforcement. Used by the handler to decide whether a class-table change actually requires re-programming CPUs.

type CpuPreference

type CpuPreference struct {
	Name string
	Cpus cpuset.CPUSet
}

CpuPreference is a named CPU set carrying a single placement preference (prefer or avoid depending on the slice it appears in).

Jump to

Keyboard shortcuts

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