cpuallocator

package
v0.2.1-0...-d3ae3b1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocateCpus

func AllocateCpus(from *cpuset.CPUSet, cnt int) (cpuset.CPUSet, error)

AllocateCpus allocates a number of CPUs from the given set.

func ReleaseCpus

func ReleaseCpus(from *cpuset.CPUSet, cnt int) (cpuset.CPUSet, error)

ReleaseCpus releases a number of CPUs from the given set.

Types

type AllocFlag

type AllocFlag uint

AllocFlag represents CPU allocation preferences.

const (
	// AllocIdlePackages requests allocation of full idle packages.
	AllocIdlePackages AllocFlag = 1 << iota
	// AllocIdleNodes requests allocation of full idle NUMA nodes.
	AllocIdleNodes
	// AllocIdleCores requests allocation of full idle cores (all threads in core).
	AllocIdleCores
	// AllocDefault is the default allocation preferences.
	AllocDefault = AllocIdlePackages | AllocIdleCores
)

type CPUAllocator

type CPUAllocator struct {
	logger.Logger // allocator logger instance
	// contains filtered or unexported fields
}

CPUAllocator encapsulates state for allocating CPUs.

func NewCPUAllocator

func NewCPUAllocator(sys *sysfs.System) *CPUAllocator

NewCPUAllocator creates a new CPU allocator.

type IDFilter

type IDFilter func(sysfs.ID) bool

IDFilter helps filtering Ids.

type IDSorter

type IDSorter func(int, int) bool

IDSorter helps sorting Ids.

Jump to

Keyboard shortcuts

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