Use of root cgroup v2 yields missing features
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 72.1k
- Forks
- 19.2k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 164
Description
Description
With cgroup v2, some features merely exist in non-root cgroups, per documentation; for instance, memory.swap.high & memory.swap.max defining swap limits.
Hence running dockerd on systems with cgroup v2 makes swap limits unavailable.
Reproduce
docker info | grep swapWARNING: No swap limit supportdocker create --name demo-swap --memory 6m busybox:latestWARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
Expected behavior
All cgroup v2 capabilities available (non-root cgroup)
docker version
Client: Docker Engine - Community
Version: 29.0.0
API version: 1.52
Go version: go1.25.4
Git commit: 3d4129b
Built: Mon Nov 10 21:46:28 2025
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 29.0.0
API version: 1.52 (minimum version 1.44)
Go version: go1.25.4
Git commit: d105562
Built: Mon Nov 10 21:46:28 2025
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: v2.1.5
GitCommit: fcd43222d6b07379a4be9786bda52438f0dd16a1
runc:
Version: 1.3.3
GitCommit: v1.3.3-0-gd842d771
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker info
Client: Docker Engine - Community
Version: 29.0.0
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.29.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.40.3
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 24
Running: 21
Paused: 0
Stopped: 3
Images: 45
Server Version: 29.0.0
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: fcd43222d6b07379a4be9786bda52438f0dd16a1
runc version: v1.3.3-0-gd842d771
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.12.48+deb13-amd64
Operating System: Devuan GNU/Linux 6 (excalibur)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.732GiB
Name: <***>
ID: IHQO:MIY4:BIHW:K7ZF:FD74:NWSG:A3ZE:EDAU:3QJU:PMER:A2HH:GA5P
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: true
Insecure Registries:
::1/128
127.0.0.0/8
Live Restore Enabled: true
Firewall Backend: iptables
WARNING: No swap limit support
Additional Info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named in the issue. Start by tracing Docker's cgroup v2 capability detection and how it handles the root cgroup, then compare that behavior with a non-root cgroup. Done means docker info reports swap-limit support and creating a memory-limited container no longer warns that swap limits are unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go, linux
- Domain
- backend, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100