runtimehandlerhooks

package
v1.30.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HighPerformance contains the high-performance runtime handler name
	HighPerformance = "high-performance"
	// IrqSmpAffinityProcFile contains the default smp affinity mask configuration
	IrqSmpAffinityProcFile = "/proc/irq/default_smp_affinity"
)
View Source
const (
	IsolatedCPUsEnvVar = "OPENSHIFT_ISOLATED_CPUS"
	SharedCPUsEnvVar   = "OPENSHIFT_SHARED_CPUS"
)

Variables

This section is empty.

Functions

func RestoreIrqBalanceConfig added in v1.20.2

func RestoreIrqBalanceConfig(ctx context.Context, irqBalanceConfigFile, irqBannedCPUConfigFile, irqSmpAffinityProcFile string) error

RestoreIrqBalanceConfig restores irqbalance service with original banned cpu mask settings

func ShouldCPUQuotaBeDisabled added in v1.26.4

func ShouldCPUQuotaBeDisabled(ctx context.Context, cid string, cSpec *specs.Spec, s *sandbox.Sandbox, annotations fields.Set) bool

func UpdateIRQSmpAffinityMask added in v1.20.0

func UpdateIRQSmpAffinityMask(cpus, current string, set bool) (cpuMask, bannedCPUMask string, err error)

UpdateIRQSmpAffinityMask take input cpus that need to change irq affinity mask and the current mask string, return an update mask string and inverted mask, with those cpus enabled or disable in the mask.

Types

type DefaultCPULoadBalanceHooks added in v1.26.4

type DefaultCPULoadBalanceHooks struct{}

DefaultCPULoadBalanceHooks is used to run additional hooks that will configure containers for CPU load balancing. Specifically, it will define a PostStop that disables `cpuset.sched_load_balance` for a recently stopped container. This must be done because guaranteed pods with exclusive cpu access may be created after other containers are terminated, but before their cgroup is cleaned up. In this case, cpumanager will not load balancing the exclusive CPUs away from those pods, thus causing their `cpuset.sched_load_balance=1` to prevent the kernel from disabling load balancing. This is the only case it seeks to fix, and thus does not define any other members of the RuntimeHandlerHooks functions.

func (*DefaultCPULoadBalanceHooks) PostStop added in v1.26.4

func (*DefaultCPULoadBalanceHooks) PreCreate added in v1.28.4

No-op

func (*DefaultCPULoadBalanceHooks) PreStart added in v1.26.4

No-op

func (*DefaultCPULoadBalanceHooks) PreStop added in v1.26.4

No-op

type HighPerformanceHook added in v1.28.3

type HighPerformanceHook interface {
	RuntimeHandlerHooks
}

type HighPerformanceHooks

type HighPerformanceHooks struct {
	// contains filtered or unexported fields
}

HighPerformanceHooks used to run additional hooks that will configure a system for the latency sensitive workloads

func (*HighPerformanceHooks) PostStop added in v1.26.4

If CPU load balancing is enabled, then *all* containers must run this PostStop hook.

func (*HighPerformanceHooks) PreCreate added in v1.28.4

func (*HighPerformanceHooks) PreStart

func (*HighPerformanceHooks) PreStop

type RuntimeHandlerHooks

type RuntimeHandlerHooks interface {
	PreCreate(ctx context.Context, specgen *generate.Generator, s *sandbox.Sandbox, c *oci.Container) error
	PreStart(ctx context.Context, c *oci.Container, s *sandbox.Sandbox) error
	PreStop(ctx context.Context, c *oci.Container, s *sandbox.Sandbox) error
	PostStop(ctx context.Context, c *oci.Container, s *sandbox.Sandbox) error
}

func GetRuntimeHandlerHooks

func GetRuntimeHandlerHooks(ctx context.Context, config *libconfig.Config, handler string, annotations map[string]string) (RuntimeHandlerHooks, error)

GetRuntimeHandlerHooks returns RuntimeHandlerHooks implementation by the runtime handler name

Jump to

Keyboard shortcuts

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