mempolicy

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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