mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
Ignore kernel memory settings
This is somewhat radical approach to deal with kernel memory. Per-cgroup kernel memory limiting was always problematic. A few examples: - older kernels had bugs and were even oopsing sometimes (best example is RHEL7 kernel); - kernel is unable to reclaim the kernel memory so once the limit is hit a cgroup is toasted; - some kernel memory allocations don't allow failing. In addition to that, - users don't have a clue about how to set kernel memory limits (as the concept is much more complicated than e.g. [user] memory); - different kernels might have different kernel memory usage, which is sort of unexpected; - cgroup v2 do not have a [dedicated] kmem limit knob, and thus runc silently ignores kernel memory limits for v2; - kernel v5.4 made cgroup v1 kmem.limit obsoleted (see https://github.com/torvalds/linux/commit/0158115f702b). In view of all this, and as the runtime-spec lists memory.kernel and memory.kernelTCP as OPTIONAL, let's ignore kernel memory limits (for cgroup v1, same as we're already doing for v2). This should result in less bugs and better user experience. The only bad side effect from it might be that stat can show kernel memory usage as 0 (since the accounting is not enabled). [v2: add a warning in specconv that limits are ignored] Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -45,8 +45,6 @@ other options are ignored.
|
||||
--cpu-share value CPU shares (relative weight vs. other containers)
|
||||
--cpuset-cpus value CPU(s) to use
|
||||
--cpuset-mems value Memory node(s) to use
|
||||
--kernel-memory value Kernel memory limit (in bytes)
|
||||
--kernel-memory-tcp value Kernel memory limit (in bytes) for tcp buffer
|
||||
--memory value Memory limit (in bytes)
|
||||
--memory-reservation value Memory reservation or soft_limit (in bytes)
|
||||
--memory-swap value Total memory usage (memory + swap); set '-1' to enable unlimited swap
|
||||
|
||||
Reference in New Issue
Block a user