opencontainers / runtime-spec

OCI Runtime Specification
http://www.opencontainers.org
Apache License 2.0
3.13k stars 535 forks source link

specs-go: mark LinuxMemory.Kernel as deprecated #1233

Closed thaJeztah closed 9 months ago

thaJeztah commented 9 months ago

Support for kernel-memory limits was deprecated in the kernel, and documented as "NOT RECOMMENDED" (or "SHOULD NOT" use) in v1.1.0-rc.1 through commit f02cd4a4273f5cf4898df4feee7dcf0d08756029.

This patch marks the field as deprecated in the go implementation of the spec, so that linters and editors produces a warning and consumers get notified of its status.

thaJeztah commented 9 months ago

FWIW I did not (yet) update the KernelTCP field, as there was some discussion about KernelTCP on the linked PR; https://github.com/opencontainers/runtime-spec/pull/1093/files#r589703045, as well as https://github.com/opencontainers/runc/issues/3174#issuecomment-1451040755

https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/cgroup-v1/memory.rst It looks like this definitely turned to "deprecated"...

The memory.kmem.tcp.limit_in_bytes knob is not listed as deprecated in the document you mention, this is the reason why we have this issue opened. I just checked the recent kernel, and unlike memory.kmem.limit_in_bytes (which was deprecated by the kernel commit 58056f77502f3567b760c9a8fc8d2e9081515b2d), the kmem.tcp is still accepted by the kernel.

Given the fact that cgroup v1 is going to be deprecated sooner or later, and we receive no bug reports about inability to set kmem.tcp limit, I guess we can leave this as is for now.

thaJeztah commented 9 months ago

If people have suggestions for the KernelTCP field, and proper wording for that, also let me know (happy to open a PR for that as well)