kubernetes: k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology Index | Files

package topology

import "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/topology"

Package topology contains helpers for the CPU manager.

Index

Package Files

doc.go topology.go

type CPUDetails Uses

type CPUDetails map[int]CPUInfo

CPUDetails is a map from CPU ID to Core ID, Socket ID, and NUMA ID.

func (CPUDetails) CPUs Uses

func (d CPUDetails) CPUs() cpuset.CPUSet

CPUs returns all of the logical CPU IDs in this CPUDetails.

func (CPUDetails) CPUsInCores Uses

func (d CPUDetails) CPUsInCores(ids ...int) cpuset.CPUSet

CPUsInCores returns all of the logical CPU IDs associated with the given core IDs in this CPUDetails.

func (CPUDetails) CPUsInNUMANodes Uses

func (d CPUDetails) CPUsInNUMANodes(ids ...int) cpuset.CPUSet

CPUsInNUMANodes returns all of the logical CPU IDs associated with the given NUMANode IDs in this CPUDetails.

func (CPUDetails) CPUsInSockets Uses

func (d CPUDetails) CPUsInSockets(ids ...int) cpuset.CPUSet

CPUsInSockets returns all of the logical CPU IDs associated with the given socket IDs in this CPUDetails.

func (CPUDetails) Cores Uses

func (d CPUDetails) Cores() cpuset.CPUSet

Cores returns all of the core IDs associated with the CPUs in this CPUDetails.

func (CPUDetails) CoresInNUMANodes Uses

func (d CPUDetails) CoresInNUMANodes(ids ...int) cpuset.CPUSet

CoresInNUMANodes returns all of the core IDs associated with the given NUMANode IDs in this CPUDetails.

func (CPUDetails) CoresInSockets Uses

func (d CPUDetails) CoresInSockets(ids ...int) cpuset.CPUSet

CoresInSockets returns all of the core IDs associated with the given socket IDs in this CPUDetails.

func (CPUDetails) KeepOnly Uses

func (d CPUDetails) KeepOnly(cpus cpuset.CPUSet) CPUDetails

KeepOnly returns a new CPUDetails object with only the supplied cpus.

func (CPUDetails) NUMANodes Uses

func (d CPUDetails) NUMANodes() cpuset.CPUSet

NUMANodes returns all of the NUMANode IDs associated with the CPUs in this CPUDetails.

func (CPUDetails) NUMANodesInSockets Uses

func (d CPUDetails) NUMANodesInSockets(ids ...int) cpuset.CPUSet

NUMANodesInSockets returns all of the logical NUMANode IDs associated with the given socket IDs in this CPUDetails.

func (CPUDetails) Sockets Uses

func (d CPUDetails) Sockets() cpuset.CPUSet

Sockets returns all of the socket IDs associated with the CPUs in this CPUDetails.

func (CPUDetails) SocketsInNUMANodes Uses

func (d CPUDetails) SocketsInNUMANodes(ids ...int) cpuset.CPUSet

SocketsInNUMANodes returns all of the logical Socket IDs associated with the given NUMANode IDs in this CPUDetails.

type CPUInfo Uses

type CPUInfo struct {
    NUMANodeID int
    SocketID   int
    CoreID     int
}

CPUInfo contains the NUMA, socket, and core IDs associated with a CPU.

type CPUTopology Uses

type CPUTopology struct {
    NumCPUs    int
    NumCores   int
    NumSockets int
    CPUDetails CPUDetails
}

CPUTopology contains details of node cpu, where : CPU - logical CPU, cadvisor - thread Core - physical CPU, cadvisor - Core Socket - socket, cadvisor - Node

func Discover Uses

func Discover(machineInfo *cadvisorapi.MachineInfo, numaNodeInfo NUMANodeInfo) (*CPUTopology, error)

Discover returns CPUTopology based on cadvisor node info

func (*CPUTopology) CPUsPerCore Uses

func (topo *CPUTopology) CPUsPerCore() int

CPUsPerCore returns the number of logical CPUs are associated with each core.

func (*CPUTopology) CPUsPerSocket Uses

func (topo *CPUTopology) CPUsPerSocket() int

CPUsPerSocket returns the number of logical CPUs are associated with each socket.

type NUMANodeInfo Uses

type NUMANodeInfo map[int]cpuset.CPUSet

NUMANodeInfo is a map from NUMANode ID to a list of CPU IDs associated with that NUMANode.

func GetNUMANodeInfo Uses

func GetNUMANodeInfo() (NUMANodeInfo, error)

GetNUMANodeInfo uses sysfs to return a map of NUMANode id to the list of CPUs associated with that NUMANode.

TODO: This is a temporary workaround until cadvisor provides this information directly in machineInfo. We should remove this once this information is available from cadvisor.

Package topology imports 6 packages (graph) and is imported by 58 packages. Updated 2019-10-02. Refresh now. Tools for package owners.