diff --git a/api/docs/CHANGELOG.md b/api/docs/CHANGELOG.md index 30a31d983c..4512117bc5 100644 --- a/api/docs/CHANGELOG.md +++ b/api/docs/CHANGELOG.md @@ -40,6 +40,11 @@ keywords: "API, Docker, rcli, REST, documentation" `GlobalIPv6Address`, `GlobalIPv6PrefixLen`, `IPAddress`, `IPPrefixLen`, `IPv6Gateway`, and `MacAddress` fields. These fields were deprecated in API v1.21 (docker v1.9.0) but kept around for backward compatibility. +* Removed the `KernelMemoryTCP` field from the `POST /containers/{id}/update` and + `GET /containers/{id}/json` endpoints, any value it is set to will be ignored + on API version `v1.52` and up. Older API versions still accept this field, but + may take no effect, depending on the kernel version and OCI runtime in use. +* Removed the `KernelMemoryTCP` field from the `GET /info` endpoint. ## v1.51 API changes @@ -50,6 +55,11 @@ keywords: "API, Docker, rcli, REST, documentation" This field was previously always -1. * Deprecated: The field `NetworkSettings.Bridge` returned by `GET /containers/{id}/json` is deprecated and will be removed in the next API version. +* Deprecated: The field `KernelMemoryTCP` as part of `POST /containers/{id}/update` + and returned by `GET /containers/{id}/json` is deprecated and will be removed + in the next API version. +* Deprecated: The field `KernelMemoryTCP` as part of `GET /info` is deprecated + and will be removed in the next API version. ## v1.50 API changes diff --git a/api/docs/v1.51.yaml b/api/docs/v1.51.yaml index 71cb3bc97f..ccde3777bd 100644 --- a/api/docs/v1.51.yaml +++ b/api/docs/v1.51.yaml @@ -636,6 +636,9 @@ definitions: by the default (runc) runtime. This field is omitted when empty. + + **Deprecated**: This field is deprecated as kernel 6.12 has deprecated `memory.kmem.tcp.limit_in_bytes` field + for cgroups v1. This field will be removed in a future release. type: "integer" format: "int64" MemoryReservation: @@ -6350,6 +6353,8 @@ definitions: Kernel memory TCP limits are not supported when using cgroups v2, which does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + + **Deprecated**: This field is deprecated as kernel 6.12 has deprecated kernel memory TCP accounting. type: "boolean" example: true CpuCfsPeriod: diff --git a/api/docs/v1.52.yaml b/api/docs/v1.52.yaml index a52934b9b6..6ccb8231bf 100644 --- a/api/docs/v1.52.yaml +++ b/api/docs/v1.52.yaml @@ -641,15 +641,6 @@ definitions: type: "array" items: $ref: "#/definitions/DeviceRequest" - KernelMemoryTCP: - description: | - Hard limit for kernel TCP buffer memory (in bytes). Depending on the - OCI runtime in use, this option may be ignored. It is no longer supported - by the default (runc) runtime. - - This field is omitted when empty. - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -6392,15 +6383,6 @@ definitions: description: "Indicates if the host has memory swap limit support enabled." type: "boolean" example: true - KernelMemoryTCP: - description: | - Indicates if the host has kernel memory TCP limit support enabled. This - field is omitted if not supported. - - 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/api/swagger.yaml b/api/swagger.yaml index a52934b9b6..6ccb8231bf 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -641,15 +641,6 @@ definitions: type: "array" items: $ref: "#/definitions/DeviceRequest" - KernelMemoryTCP: - description: | - Hard limit for kernel TCP buffer memory (in bytes). Depending on the - OCI runtime in use, this option may be ignored. It is no longer supported - by the default (runc) runtime. - - This field is omitted when empty. - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -6392,15 +6383,6 @@ definitions: description: "Indicates if the host has memory swap limit support enabled." type: "boolean" example: true - KernelMemoryTCP: - description: | - Indicates if the host has kernel memory TCP limit support enabled. This - field is omitted if not supported. - - 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/api/types/container/hostconfig.go b/api/types/container/hostconfig.go index e04f5a3c96..f167d80599 100644 --- a/api/types/container/hostconfig.go +++ b/api/types/container/hostconfig.go @@ -389,14 +389,12 @@ type Resources struct { Devices []DeviceMapping // List of devices to map inside the container DeviceCgroupRules []string // List of rule to be added to the device cgroup DeviceRequests []DeviceRequest // List of device requests for device drivers - - KernelMemoryTCP int64 `json:",omitempty"` // Hard limit for kernel TCP buffer memory (in bytes) - MemoryReservation int64 // Memory soft limit (in bytes) - MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap - MemorySwappiness *int64 // Tuning container memory swappiness behaviour - OomKillDisable *bool // Whether to disable OOM Killer or not - PidsLimit *int64 // Setting PIDs limit for a container; Set `0` or `-1` for unlimited, or `null` to not change. - Ulimits []*Ulimit // List of ulimits to be set in the container + MemoryReservation int64 // Memory soft limit (in bytes) + MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap + MemorySwappiness *int64 // Tuning container memory swappiness behaviour + OomKillDisable *bool // Whether to disable OOM Killer or not + PidsLimit *int64 // Setting PIDs limit for a container; Set `0` or `-1` for unlimited, or `null` to not change. + Ulimits []*Ulimit // List of ulimits to be set in the container // Applicable to Windows CPUCount int64 `json:"CpuCount"` // CPU count diff --git a/api/types/system/info.go b/api/types/system/info.go index d87f0e679d..4bbc8c8aba 100644 --- a/api/types/system/info.go +++ b/api/types/system/info.go @@ -21,7 +21,6 @@ type Info struct { Plugins PluginsInfo MemoryLimit bool SwapLimit bool - KernelMemoryTCP bool `json:",omitempty"` // KernelMemoryTCP is not supported on cgroups v2. CPUCfsPeriod bool `json:"CpuCfsPeriod"` CPUCfsQuota bool `json:"CpuCfsQuota"` CPUShares bool diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 96b7a11523..7b9b68d7d4 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -103,9 +103,6 @@ func getMemoryResources(config containertypes.Resources) *specs.LinuxMemory { if config.OomKillDisable != nil { memory.DisableOOMKiller = config.OomKillDisable } - if config.KernelMemoryTCP != 0 { - memory.KernelTCP = &config.KernelMemoryTCP - } if memory != (specs.LinuxMemory{}) { return &memory diff --git a/daemon/info_unix.go b/daemon/info_unix.go index e1b383b96c..9456f40e05 100644 --- a/daemon/info_unix.go +++ b/daemon/info_unix.go @@ -34,7 +34,6 @@ func (daemon *Daemon) fillPlatformInfo(ctx context.Context, v *system.Info, sysI if v.CgroupDriver != cgroupNoneDriver { v.MemoryLimit = sysInfo.MemoryLimit v.SwapLimit = sysInfo.SwapLimit - v.KernelMemoryTCP = sysInfo.KernelMemoryTCP v.OomKillDisable = sysInfo.OomKillDisable v.CPUCfsPeriod = sysInfo.CPUCfs v.CPUCfsQuota = sysInfo.CPUCfs @@ -93,11 +92,6 @@ func (daemon *Daemon) fillPlatformInfo(ctx context.Context, v *system.Info, sysI if !v.SwapLimit { v.Warnings = append(v.Warnings, "WARNING: No swap limit support") } - if !v.KernelMemoryTCP && v.CgroupVersion == "1" { - // kernel memory is not available for cgroup v2. - // Warning is not printed on cgroup v2, because there is no action user can take. - v.Warnings = append(v.Warnings, "WARNING: No kernel memory TCP limit support") - } if !v.OomKillDisable && v.CgroupVersion == "1" { // oom kill disable is not available for cgroup v2. // Warning is not printed on cgroup v2, because there is no action user can take. diff --git a/daemon/server/router/container/container_routes.go b/daemon/server/router/container/container_routes.go index 35ecc41d8c..5941576868 100644 --- a/daemon/server/router/container/container_routes.go +++ b/daemon/server/router/container/container_routes.go @@ -537,9 +537,6 @@ func (c *containerRouter) postContainersCreate(ctx context.Context, w http.Respo } } - // Ignore KernelMemoryTCP because it was added in API 1.40. - hostConfig.KernelMemoryTCP = 0 - // Older clients (API < 1.40) expects the default to be shareable, make them happy if hostConfig.IpcMode.IsEmpty() { hostConfig.IpcMode = container.IPCModeShareable diff --git a/pkg/sysinfo/cgroup2_linux.go b/pkg/sysinfo/cgroup2_linux.go index b6ce501bdd..2c09b66739 100644 --- a/pkg/sysinfo/cgroup2_linux.go +++ b/pkg/sysinfo/cgroup2_linux.go @@ -84,7 +84,6 @@ func applyMemoryCgroupInfoV2(info *SysInfo) { info.MemoryReservation = true info.OomKillDisable = false info.MemorySwappiness = false - info.KernelMemoryTCP = false } func applyCPUCgroupInfoV2(info *SysInfo) { diff --git a/pkg/sysinfo/sysinfo.go b/pkg/sysinfo/sysinfo.go index 85a0e89ba6..135911f279 100644 --- a/pkg/sysinfo/sysinfo.go +++ b/pkg/sysinfo/sysinfo.go @@ -63,10 +63,6 @@ type cgroupMemInfo struct { // Whether memory swappiness is supported or not MemorySwappiness bool - - // Whether kernel memory TCP limit is supported or not. Kernel memory TCP - // limit (`memory.kmem.tcp.limit_in_bytes`) is not supported on cgroups v2. - KernelMemoryTCP bool } type cgroupCPUInfo struct { diff --git a/pkg/sysinfo/sysinfo_linux.go b/pkg/sysinfo/sysinfo_linux.go index 0a39797b2d..47a982b35d 100644 --- a/pkg/sysinfo/sysinfo_linux.go +++ b/pkg/sysinfo/sysinfo_linux.go @@ -152,11 +152,6 @@ func applyMemoryCgroupInfo(info *SysInfo) { if !info.MemorySwappiness { info.Warnings = append(info.Warnings, "Your kernel does not support memory swappiness") } - - // Option is deprecated in runc, but still accepted in our API, so setting - // the field to allow feature detection, but don't warn if it's missing, to - // make the daemon logs a bit less noisy. - info.KernelMemoryTCP = cgroupEnabled(mountPoint, "memory.kmem.tcp.limit_in_bytes") } // applyCPUCgroupInfo adds the cpu cgroup controller information to the info. diff --git a/vendor/github.com/moby/moby/api/types/container/hostconfig.go b/vendor/github.com/moby/moby/api/types/container/hostconfig.go index e04f5a3c96..f167d80599 100644 --- a/vendor/github.com/moby/moby/api/types/container/hostconfig.go +++ b/vendor/github.com/moby/moby/api/types/container/hostconfig.go @@ -389,14 +389,12 @@ type Resources struct { Devices []DeviceMapping // List of devices to map inside the container DeviceCgroupRules []string // List of rule to be added to the device cgroup DeviceRequests []DeviceRequest // List of device requests for device drivers - - KernelMemoryTCP int64 `json:",omitempty"` // Hard limit for kernel TCP buffer memory (in bytes) - MemoryReservation int64 // Memory soft limit (in bytes) - MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap - MemorySwappiness *int64 // Tuning container memory swappiness behaviour - OomKillDisable *bool // Whether to disable OOM Killer or not - PidsLimit *int64 // Setting PIDs limit for a container; Set `0` or `-1` for unlimited, or `null` to not change. - Ulimits []*Ulimit // List of ulimits to be set in the container + MemoryReservation int64 // Memory soft limit (in bytes) + MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap + MemorySwappiness *int64 // Tuning container memory swappiness behaviour + OomKillDisable *bool // Whether to disable OOM Killer or not + PidsLimit *int64 // Setting PIDs limit for a container; Set `0` or `-1` for unlimited, or `null` to not change. + Ulimits []*Ulimit // List of ulimits to be set in the container // Applicable to Windows CPUCount int64 `json:"CpuCount"` // CPU count diff --git a/vendor/github.com/moby/moby/api/types/system/info.go b/vendor/github.com/moby/moby/api/types/system/info.go index d87f0e679d..4bbc8c8aba 100644 --- a/vendor/github.com/moby/moby/api/types/system/info.go +++ b/vendor/github.com/moby/moby/api/types/system/info.go @@ -21,7 +21,6 @@ type Info struct { Plugins PluginsInfo MemoryLimit bool SwapLimit bool - KernelMemoryTCP bool `json:",omitempty"` // KernelMemoryTCP is not supported on cgroups v2. CPUCfsPeriod bool `json:"CpuCfsPeriod"` CPUCfsQuota bool `json:"CpuCfsQuota"` CPUShares bool