irq

package
Version: v0.0.0-...-99d1f25 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package irq contains wrapper module around cpu manager file to retrieve updated pod cpu information, helper methods to derive irq affinity and banned masks, write to approproiate configuration files.

Index

Constants

View Source
const (
	// IrqSmpAffinityProcFile file containing irq mask settings
	IrqSmpAffinityProcFile = "/host/proc/irq/default_smp_affinity"
	// PodIrqBannedCPUsFile file containing irq balance banned cpus parameter
	PodIrqBannedCPUsFile = "/host/etc/sysconfig/pod_irq_banned_cpus"
	// IrqBalanceBannedCpus key for IRQBALANCE_BANNED_CPUS parameter
	IrqBalanceBannedCpus = "IRQBALANCE_BANNED_CPUS"
)

Variables

This section is empty.

Functions

func InvertMaskStringWithComma

func InvertMaskStringWithComma(maskStringWithComma string) (string, error)

InvertMaskStringWithComma invert the give mask string retaining the comma

func ResetIRQBalance

func ResetIRQBalance(irqBalanceConfigFile, newIRQBalanceSetting string) error

ResetIRQBalance restart irqbalance daemon with newIRQBalanceSetting

func RetrieveCPUMask

func RetrieveCPUMask(irqSmpAffinityFile string) (string, error)

RetrieveCPUMask retrieves cpu masks set in irq smp affinity file

func SetIRQLoadBalancing

func SetIRQLoadBalancing(cpus string, enable bool, irqSmpAffinityFile, podIrqBannedCPUsFile string) error

SetIRQLoadBalancing enable or disable the irq loadbalance on given cpus

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 CPUManagerService

type CPUManagerService interface {
	GetAssignedCpus(podUID string) (string, error)
	GetAssignedCpusFromCache(podUID string) string
	Remove(podUID string)
}

CPUManagerService APIs for retrieving assigned cpus

func NewCPUManagerService

func NewCPUManagerService() (CPUManagerService, error)

NewCPUManagerService returns new cpu manager service

func NewCPUManagerServiceWithEntries

func NewCPUManagerServiceWithEntries(v1 map[string]string, v2 map[string]map[string]string) (CPUManagerService, error)

NewCPUManagerServiceWithEntries returns new cpu manager service with pre populated cache entries

Source Files

Jump to

Keyboard shortcuts

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