Skip to content

Remove support for deprecated kernel memory limit#50989

Merged
thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah:remove_KernelMemory
Sep 17, 2025
Merged

Remove support for deprecated kernel memory limit#50989
thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah:remove_KernelMemory

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Sep 16, 2025

relates to:

remove support for deprecated kernel memory limit

kernel-memory limits are not supported in cgroups v2, and were obsoleted in kernel v5.4, producing a ENOTSUP in kernel v5.16. Support for this option was removed in runc and other runtimes, as various LTS kernels contained a broken implementation, resulting in unpredictable behavior.

We deprecated this option in moby@b8ca7de, producing a warning when used, and actively ignore the option since moby@0798f5f.

Given that setting this option had no effect in most situations, we should just remove this option instead of continuing to handle it with the expectation that a runtime may still support it.

Note that we still support RHEL 8 (kernel 4.18) and RHEL 9 (kernel 5.14). We no longer build packages for Ubuntu 20.04 (kernel 5.4) and Debian Bullseye 11 (kernel 5.10), which still have an LTS / ESM programme, but for those it would only impact situations where a runtime is used that still supports it, and an old API version was used.

api/docs: remove KernelMemory option from old API versions

This option is no longer supported by runc, and is deprecated in the kernel.
We removed support for this feature from all API versions, so it's better
to also amend the docs for older API versions.

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

kernel-memory limits are not supported in cgroups v2, and were obsoleted in
[kernel v5.4], producing a `ENOTSUP` in kernel v5.16. Support for this option
was removed in runc and other runtimes, as various LTS kernels contained a
broken implementation, resulting in unpredictable behavior.

We deprecated this option in [moby/moby@b8ca7de], producing a warning when used,
and actively ignore the option since [moby/moby@0798f5f].

Given that setting this option had no effect in most situations, we should
just remove this option instead of continuing to handle it with the expectation
that a runtime may still support it.

Note that we still support RHEL 8 (kernel 4.18) and RHEL 9 (kernel 5.14). We
no longer build packages for Ubuntu 20.04 (kernel 5.4) and Debian Bullseye 11
(kernel 5.10), which still have an LTS / ESM programme, but for those it would
only impact situations where a runtime is used that still supports it, and
an old API version was used.

[kernel v5.4]: torvalds/linux@0158115f702b0ba208ab0
[moby/moby@b8ca7de]: moby@b8ca7de
[moby/moby@0798f5f]: moby@0798f5f

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 29.0.0 milestone Sep 16, 2025
@thaJeztah thaJeztah added area/api API status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Sep 16, 2025
This option is no longer supported by runc, and is deprecated in the kernel.
We removed support for this feature from all API versions, so it's better
to also amend the docs for older API versions.

[kernel v5.4]: torvalds/linux@0158115f702b0ba208ab0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
// KernelMemory specifies the kernel memory limit (in bytes) for the container.
// Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes.
KernelMemory int64 `json:",omitempty"`
KernelMemoryTCP int64 `json:",omitempty"` // Hard limit for kernel TCP buffer memory (in bytes)
Copy link
Member Author

@thaJeztah thaJeztah Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW; we should also deprecate the KernelMemoryTCP; there originally was some back-and-forth if this should also be considered deprecated by the kernel, but all info I found looks to now be pointing to that being the case. runc already removed support for it; opencontainers/runc#3174, and the OCI marked it as deprecated; opencontainers/runtime-spec#1093

I'll create a tracking ticket for a follow-up

@thaJeztah thaJeztah marked this pull request as ready for review September 16, 2025 12:37
@thaJeztah thaJeztah added the release-blocker PRs we want to block a release on label Sep 16, 2025
Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@thaJeztah
Copy link
Member Author

Thx! I'll bring this one in, and have a look at the follow-up for KernelMemoryTCP

@thaJeztah thaJeztah merged commit 2b4f559 into moby:master Sep 17, 2025
185 checks passed
@thaJeztah thaJeztah deleted the remove_KernelMemory branch September 17, 2025 10:06
@vvoland vvoland changed the title remove support for deprecated kernel memory limit Remove support for deprecated kernel memory limit Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API kind/refactor PR's that refactor, or clean-up code release-blocker PRs we want to block a release on status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants