Files
runc/libcontainer/configs/memorypolicy.go
T
Kir Kolyshkin 3741f9186d libct/configs: mark MPOL_* constants as deprecated
Alas, these new constants are already in v1.4.0 release so we can't
remove those right away, but we can mark them as deprecated now
and target removal for v1.5.0.

So,
 - mark them as deprecated;
 - redefine via unix.MPOL_* counterparts;
 - fix the validator code to use unix.MPOL_* directly.

This amends commit a0e809a8.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-12-08 15:36:29 -08:00

34 lines
1.2 KiB
Go

package configs
import "golang.org/x/sys/unix"
// Memory policy modes and flags as defined in /usr/include/linux/mempolicy.h
//
// Deprecated: use constants from [unix] instead.
//
//nolint:revive,staticcheck,nolintlint // ignore ALL_CAPS errors in consts from numaif.h, will match unix.* in the future
const (
MPOL_DEFAULT = unix.MPOL_DEFAULT
MPOL_PREFERRED = unix.MPOL_PREFERRED
MPOL_BIND = unix.MPOL_BIND
MPOL_INTERLEAVE = unix.MPOL_INTERLEAVE
MPOL_LOCAL = unix.MPOL_LOCAL
MPOL_PREFERRED_MANY = unix.MPOL_PREFERRED_MANY
MPOL_WEIGHTED_INTERLEAVE = unix.MPOL_WEIGHTED_INTERLEAVE
MPOL_F_STATIC_NODES = unix.MPOL_F_STATIC_NODES
MPOL_F_RELATIVE_NODES = unix.MPOL_F_RELATIVE_NODES
MPOL_F_NUMA_BALANCING = unix.MPOL_F_NUMA_BALANCING
)
// LinuxMemoryPolicy contains memory policy configuration.
type LinuxMemoryPolicy struct {
// Mode specifies memory policy mode without mode flags. See
// set_mempolicy() documentation for details.
Mode int `json:"mode,omitempty"`
// Flags contains mode flags.
Flags int `json:"flags,omitempty"`
// Nodes contains NUMA nodes to which the mode applies.
Nodes *unix.CPUSet `json:"nodes,omitempty"`
}