dynamicpolicy

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 61 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// GetNumaForPagesMaxEachTime get numa for 16384 pages(64MB) at most at a time
	GetNumaForPagesMaxEachTime = 16384

	// MovePagesMaxEachTime means move 5120 pages(20MB) at most at a time
	MovePagesMaxEachTime = 5120

	// MovePagesMinEachTime means move 256 pages(1MB) at least at a time
	MovePagesMinEachTime = 256

	// MovePagesAcceptableTimeCost is acceptable time cost of each move pages is 20ms
	MovePagesAcceptableTimeCost = 20
	MBytes                      = 1024 * 1024

	// MinRSSSkipMigrate is min rss size to skip migrate the process numa pages.
	MinRSSSkipMigrate = 10 * MBytes

	SystemNodeDir = "/sys/devices/system/node/"
	ProcDir       = "/proc"
)
View Source
const MPOL_MF_MOVE = (1 << 1)

MPOL_MF_MOVE means move pages owned by this process to conform to policy

View Source
const (
	MemoryResourcePluginPolicyNameDynamic = string(apiconsts.ResourcePluginPolicyNameDynamic)
)

Variables

This section is empty.

Functions

func GetFullyDropCacheBytes added in v0.4.1

func GetFullyDropCacheBytes(container *v1.Container) int64

func GetReadonlyState

func GetReadonlyState() (state.ReadonlyState, error)

GetReadonlyState returns state.ReadonlyState to provides a way to obtain the running states of the plugin

func MigratePagesForContainer added in v0.3.0

func MigratePagesForContainer(ctx context.Context, podUID, containerId string,
	numasCount int, sourceNUMAs, destNUMAs machine.CPUSet,
) error

MigratePagesForContainer uses SYS_MIGRATE_PAGES syscall to migrate container process memory from sourceNUMAs to destNUMAs, and it may block process when migration. It is deprecated will be removed in a future release.

func MovePagesForContainer added in v0.4.1

func MovePagesForContainer(ctx context.Context, podUID, containerId string,
	sourceNUMAs, destNUMAs machine.CPUSet,
) error

MovePagesForContainer uses SYS_MOVE_PAGES syscall to migrate container process memory from sourceNUMAs to destNUMAs, which has more fine-grained locks than migrate_page.

func MovePagesForProcess added in v0.4.1

func MovePagesForProcess(ctx context.Context, procDir string, pid int, srcNumas []int, dstNumas []int) error

func NewDynamicPolicy

func NewDynamicPolicy(agentCtx *agent.GenericContext, conf *config.Configuration,
	_ interface{}, agentName string,
) (bool, agent.Component, error)

Types

type DynamicPolicy

type DynamicPolicy struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*DynamicPolicy) Allocate

Allocate is called during pod admit so that the resource plugin can allocate corresponding resource for the container according to resource request

func (*DynamicPolicy) AllocateForPod added in v0.5.8

AllocateForPod is called during pod admit so that the resource plugin can allocate corresponding resource for the pod according to resource request

func (*DynamicPolicy) GetPodTopologyHints added in v0.5.8

GetPodTopologyHints returns hints of corresponding resources for pod

func (*DynamicPolicy) GetResourcePluginOptions

func (p *DynamicPolicy) GetResourcePluginOptions(context.Context,
	*pluginapi.Empty,
) (*pluginapi.ResourcePluginOptions, error)

GetResourcePluginOptions returns options to be communicated with Resource Manager

func (*DynamicPolicy) GetResourcesAllocation

GetResourcesAllocation returns allocation results of corresponding resources

func (*DynamicPolicy) GetTopologyAwareAllocatableResources

GetTopologyAwareAllocatableResources returns corresponding allocatable resources as topology aware format

func (*DynamicPolicy) GetTopologyAwareResources

GetTopologyAwareResources returns allocation results of corresponding resources as topology aware format

func (*DynamicPolicy) GetTopologyHints

GetTopologyHints returns hints of corresponding resources

func (*DynamicPolicy) ListContainers added in v0.4.0

func (*DynamicPolicy) Name

func (p *DynamicPolicy) Name() string

func (*DynamicPolicy) PollOOMBPFInit added in v0.4.0

func (p *DynamicPolicy) PollOOMBPFInit(stopCh <-chan struct{})

func (*DynamicPolicy) PreStartContainer

PreStartContainer is called, if indicated by resource plugin during registration phase, before each container start. Resource plugin can run resource specific operations such as resetting the resource before making resources available to the container

func (*DynamicPolicy) RemovePod

func (*DynamicPolicy) ResourceName

func (p *DynamicPolicy) ResourceName() string

func (*DynamicPolicy) Start

func (p *DynamicPolicy) Start() (err error)

func (*DynamicPolicy) Stop

func (p *DynamicPolicy) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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