From 203d97df59f30970e0e25a6b77d098cc3f29ded5 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 7 Feb 2022 15:48:04 +0100 Subject: [PATCH 1/3] api/swagger.yml: add KernelMemoryTCP to /info endpoint While this feature is deprecated / unsupported on cgroups v2, it's part of the API, so let's at least document it. Signed-off-by: Sebastiaan van Stijn --- api/swagger.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/swagger.yaml b/api/swagger.yaml index 46505d06c0..9ac234dcd9 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -4468,6 +4468,14 @@ definitions: > `kmem.limit_in_bytes`. type: "boolean" example: true + KernelMemoryTCP: + description: | + Indicates if the host has kernel memory TCP limit support enabled. + + Kernel memory TCP limits are not supported when using cgroups v2, which + does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + type: "boolean" + example: true CpuCfsPeriod: description: | Indicates if CPU CFS(Completely Fair Scheduler) period is supported by From 9f3c238c2912205514e65a48272a3a65589c86c5 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 7 Feb 2022 18:27:38 +0100 Subject: [PATCH 2/3] docs: add missing KernelMemoryTCP to api v1.40 and v1.41 Signed-off-by: Sebastiaan van Stijn --- docs/api/v1.40.yaml | 8 ++++++++ docs/api/v1.41.yaml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/api/v1.40.yaml b/docs/api/v1.40.yaml index 8e7ddda128..54b11fd236 100644 --- a/docs/api/v1.40.yaml +++ b/docs/api/v1.40.yaml @@ -4346,6 +4346,14 @@ definitions: description: "Indicates if the host has kernel memory limit support enabled." type: "boolean" example: true + KernelMemoryTCP: + description: | + Indicates if the host has kernel memory TCP limit support enabled. + + Kernel memory TCP limits are not supported when using cgroups v2, which + does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + type: "boolean" + example: true CpuCfsPeriod: description: | Indicates if CPU CFS(Completely Fair Scheduler) period is supported by diff --git a/docs/api/v1.41.yaml b/docs/api/v1.41.yaml index 566999c5df..209ba159ca 100644 --- a/docs/api/v1.41.yaml +++ b/docs/api/v1.41.yaml @@ -4467,6 +4467,14 @@ definitions: > `kmem.limit_in_bytes`. type: "boolean" example: true + KernelMemoryTCP: + description: | + Indicates if the host has kernel memory TCP limit support enabled. + + Kernel memory TCP limits are not supported when using cgroups v2, which + does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + type: "boolean" + example: true CpuCfsPeriod: description: | Indicates if CPU CFS(Completely Fair Scheduler) period is supported by From 3c44ade6d00df46022ae3927d938c7b27c602e6c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 7 Feb 2022 15:11:41 +0100 Subject: [PATCH 3/3] daemon: fix error-message for minimum allowed kernel-memory limit Signed-off-by: Sebastiaan van Stijn --- daemon/daemon_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 1aabe1d9fd..e5c6dbbc5a 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -452,7 +452,7 @@ func verifyPlatformContainerResources(resources *containertypes.Resources, sysIn resources.KernelMemory = 0 } if resources.KernelMemory > 0 && resources.KernelMemory < linuxMinMemory { - return warnings, fmt.Errorf("Minimum kernel memory limit allowed is 4MB") + return warnings, fmt.Errorf("Minimum kernel memory limit allowed is 6MB") } if resources.KernelMemory > 0 && !kernel.CheckKernelVersion(4, 0, 0) { warnings = append(warnings, "You specified a kernel memory limit on a kernel older than 4.0. Kernel memory limits are experimental on older kernels, it won't work as expected and can cause your system to be unstable.")