From 6a77ee7864770d2e81142dfd63e14314e832666f Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Wed, 4 Mar 2026 20:47:29 +1100 Subject: [PATCH] libct: remove deprecated MPOL_* constants These were inadvertently added to our exported APIs by commit eeda7bdf80cca ("Add memory policy support"). We couldn't remove them from runc 1.4.x, but we deprecated them in commit 3741f9186d21 ("libct/configs: mark MPOL_* constants as deprecated") and marked them for removal in runc 1.5. Users should never have used these in the first place. Signed-off-by: Aleksa Sarai --- CHANGELOG.md | 3 ++- libcontainer/configs/memorypolicy.go | 19 ------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fdb2cb92..3759fb51d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `libcontainer/configs.Thawed` - `libcontainer/configs.NewWeightDevice` - `libcontainer/configs.NewThrottleDevice` - - `libcontainer/configs.HookList.RunHooks` (#5141) + - `libcontainer/configs.HookList.RunHooks`. (#5141) + - `libcontainer/configs.MPOL_*` (#5414) ## [1.4.0] - 2025-11-27 diff --git a/libcontainer/configs/memorypolicy.go b/libcontainer/configs/memorypolicy.go index b7b9c6bce..81bff0d10 100644 --- a/libcontainer/configs/memorypolicy.go +++ b/libcontainer/configs/memorypolicy.go @@ -2,25 +2,6 @@ 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