Documentation ¶
Index ¶
- Constants
- func RestoreIrqBalanceConfig(ctx context.Context, ...) error
- func ShouldCPUQuotaBeDisabled(ctx context.Context, cid string, cSpec *specs.Spec, s *sandbox.Sandbox, ...) bool
- func UpdateIRQSmpAffinityMask(cpus, current string, set bool) (cpuMask, bannedCPUMask string, err error)
- type DefaultCPULoadBalanceHooks
- func (*DefaultCPULoadBalanceHooks) PostStop(ctx context.Context, c *oci.Container, s *sandbox.Sandbox) error
- func (*DefaultCPULoadBalanceHooks) PreCreate(context.Context, *generate.Generator, *sandbox.Sandbox, *oci.Container) error
- func (*DefaultCPULoadBalanceHooks) PreStart(context.Context, *oci.Container, *sandbox.Sandbox) error
- func (*DefaultCPULoadBalanceHooks) PreStop(context.Context, *oci.Container, *sandbox.Sandbox) error
- type HighPerformanceHook
- type HighPerformanceHooks
- func (*HighPerformanceHooks) PostStop(ctx context.Context, c *oci.Container, s *sandbox.Sandbox) error
- func (h *HighPerformanceHooks) PreCreate(ctx context.Context, specgen *generate.Generator, s *sandbox.Sandbox, ...) error
- func (h *HighPerformanceHooks) PreStart(ctx context.Context, c *oci.Container, s *sandbox.Sandbox) error
- func (h *HighPerformanceHooks) PreStop(ctx context.Context, c *oci.Container, s *sandbox.Sandbox) error
- type RuntimeHandlerHooks
Constants ¶
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" )
const ( IsolatedCPUsEnvVar = "OPENSHIFT_ISOLATED_CPUS" )
Variables ¶
This section is empty.
Functions ¶
func RestoreIrqBalanceConfig ¶
func RestoreIrqBalanceConfig(ctx context.Context, irqBalanceConfigFile, irqBannedCPUConfigFile, irqSmpAffinityProcFile string) error
RestoreIrqBalanceConfig restores irqbalance service with original banned cpu mask settings
func UpdateIRQSmpAffinityMask ¶
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 ¶
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) PreCreate ¶
func (*DefaultCPULoadBalanceHooks) PreCreate(context.Context, *generate.Generator, *sandbox.Sandbox, *oci.Container) error
No-op
type HighPerformanceHook ¶
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 ¶
func (*HighPerformanceHooks) PostStop(ctx context.Context, c *oci.Container, s *sandbox.Sandbox) error
If CPU load balancing is enabled, then *all* containers must run this PostStop hook.
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 }