policy

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccumulateProvidersHints

func AccumulateProvidersHints(container *v1.Container,
	topoInfo *api.NumatopoInfo, resNumaSets api.ResNumaSets,
	hintProviders []HintProvider) (providersHints []map[string][]TopologyHint)

AccumulateProvidersHints return all TopologyHint collection from different providers

func Allocate

func Allocate(container *v1.Container, bestHit *TopologyHint,
	topoInfo *api.NumatopoInfo, resNumaSets api.ResNumaSets, hintProviders []HintProvider) map[string]cpuset.CPUSet

Allocate return all resource assignment collection from different providers

Types

type HintProvider

type HintProvider interface {
	// Name returns provider name used for register and logging.
	Name() string
	// GetTopologyHints returns hints if this hint provider has a preference,
	GetTopologyHints(container *v1.Container, topoInfo *api.NumatopoInfo, resNumaSets api.ResNumaSets) map[string][]TopologyHint
	Allocate(container *v1.Container, bestHit *TopologyHint, topoInfo *api.NumatopoInfo, resNumaSets api.ResNumaSets) map[string]cpuset.CPUSet
}

HintProvider is an interface for components that want to collaborate to achieve globally optimal concrete resource alignment with respect to NUMA locality.

type Policy

type Policy interface {
	// Predicate Get the best hit.
	Predicate(providersHints []map[string][]TopologyHint) (TopologyHint, bool)
}

Policy is an interface for topology manager policy

func GetPolicy

func GetPolicy(node *api.NodeInfo, numaNodes []int) Policy

GetPolicy return the interface matched the input task topology config

func NewPolicyBestEffort

func NewPolicyBestEffort(numaNodes []int) Policy

NewPolicyBestEffort return a new policy interface

func NewPolicyNone

func NewPolicyNone(numaNodes []int) Policy

NewPolicyNone return a new policy interface

func NewPolicyRestricted

func NewPolicyRestricted(numaNodes []int) Policy

NewPolicyRestricted return a new policy interface

func NewPolicySingleNumaNode

func NewPolicySingleNumaNode(numaNodes []int) Policy

NewPolicySingleNumaNode return a new policy interface

type TopologyHint

type TopologyHint struct {
	NUMANodeAffinity bitmask.BitMask
	// Preferred is set to true when the NUMANodeAffinity encodes a preferred
	// allocation for the Container. It is set to false otherwise.
	Preferred bool
}

TopologyHint is a struct containing the NUMANodeAffinity for a Container

Jump to

Keyboard shortcuts

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