mempolicy

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

mempolicy package provides low-level functions to set and get default memory policyfor a process using the Linux kernel's set_mempolicy and get_mempolicy syscalls.

Index

Constants

View Source
const (
	MPOL_DEFAULT = iota
	MPOL_PREFERRED
	MPOL_BIND
	MPOL_INTERLEAVE
	MPOL_LOCAL
	MPOL_PREFERRED_MANY
	MPOL_WEIGHTED_INTERLEAVE

	MPOL_F_STATIC_NODES   uint = (1 << 15)
	MPOL_F_RELATIVE_NODES uint = (1 << 14)
	MPOL_F_NUMA_BALANCING uint = (1 << 13)

	SYS_SET_MEMPOLICY = 238
	SYS_GET_MEMPOLICY = 239

	MAX_NUMA_NODES = 1024
)

Variables

View Source
var FlagNames map[uint]string
View Source
var Flags = map[string]uint{
	"MPOL_F_STATIC_NODES":   MPOL_F_STATIC_NODES,
	"MPOL_F_RELATIVE_NODES": MPOL_F_RELATIVE_NODES,
	"MPOL_F_NUMA_BALANCING": MPOL_F_NUMA_BALANCING,
}
View Source
var ModeNames map[uint]string
View Source
var Modes = map[string]uint{
	"MPOL_DEFAULT":             MPOL_DEFAULT,
	"MPOL_PREFERRED":           MPOL_PREFERRED,
	"MPOL_BIND":                MPOL_BIND,
	"MPOL_INTERLEAVE":          MPOL_INTERLEAVE,
	"MPOL_LOCAL":               MPOL_LOCAL,
	"MPOL_PREFERRED_MANY":      MPOL_PREFERRED_MANY,
	"MPOL_WEIGHTED_INTERLEAVE": MPOL_WEIGHTED_INTERLEAVE,
}

Functions

func GetMempolicy

func GetMempolicy() (uint, []int, error)

GetMempolicy calls get_mempolicy syscall

func SetMempolicy

func SetMempolicy(mpol uint, nodes []int) error

SetMempolicy calls set_mempolicy syscall

Types

This section is empty.

Jump to

Keyboard shortcuts

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