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
- func InvertMaskStringWithComma(maskStringWithComma string) (string, error)
- func ResetIRQBalance(irqBalanceConfigFile, newIRQBalanceSetting string) error
- func RetrieveCPUMask(irqSmpAffinityFile string) (string, error)
- func SetIRQLoadBalancing(cpus string, enable bool, irqSmpAffinityFile, podIrqBannedCPUsFile string) error
- func UpdateIRQSmpAffinityMask(cpus, current string, set bool) (cpuMask, bannedCPUMask string, err error)
- type CPUManagerService
Constants ¶
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 ¶
InvertMaskStringWithComma invert the give mask string retaining the comma
func ResetIRQBalance ¶
ResetIRQBalance restart irqbalance daemon with newIRQBalanceSetting
func RetrieveCPUMask ¶
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