numalign

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SysDevicesSystemNodeDir = "devices/system/node"
	SysBusPCIDevicesDir     = "bus/pci/devices/"
)

Variables

This section is empty.

Functions

func GetAllowedCPUList

func GetAllowedCPUList(fs vfs.VFS, statusFile string) ([]int, error)

func GetCPUToNUMANodeMap

func GetCPUToNUMANodeMap(fs vfs.VFS, sysNodeDir string, cpuIDs []int) (map[int]int, error)

func GetCPUsPerNUMANode

func GetCPUsPerNUMANode(fs vfs.VFS, sysfsdir string) (map[int][]int, error)

func GetPCIDeviceNUMANode

func GetPCIDeviceNUMANode(fs vfs.VFS, sysPCIDir string, devs []string) (map[string]int, error)

func GetPCIDeviceToNumaNodeMap

func GetPCIDeviceToNumaNodeMap(fs vfs.VFS, sysBusPCIDir string, pciDevs []string) (map[string]int, error)

func GetPCIDevicesFromEnv

func GetPCIDevicesFromEnv(environ []string) []string

func MakeCPUsToNUMANodeMap

func MakeCPUsToNUMANodeMap(cpusPerNUMA map[int][]int) map[int]int

Types

type Resources

type Resources struct {
	CPUToNUMANode     map[int]int    `json:"cpus"`
	PCIDevsToNUMANode map[string]int `json:"pcidevices"`
}

func NewResources

func NewResources(fs vfs.VFS, procfsRoot, sysfsRoot string, environ, pids []string) (*Resources, error)

func (*Resources) CheckAlignment

func (numaRes *Resources) CheckAlignment() Result

func (*Resources) JSON

func (numaRes *Resources) JSON() string

type Result

type Result struct {
	Aligned    bool       `json:"aligned"`
	NUMACellID int        `json:"numacellid"`
	Resources  *Resources `json:"resources",omitempty`
}

func (Result) JSON

func (re Result) JSON() string

Jump to

Keyboard shortcuts

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