Skip to content

[20.10 backport] hack/dind: fix cgroup v2 evacuation with docker run --init#42342

Merged
tianon merged 1 commit into
moby:20.10from
AkihiroSuda:dind-fix-cgroup2-evac-2010
Apr 30, 2021
Merged

[20.10 backport] hack/dind: fix cgroup v2 evacuation with docker run --init#42342
tianon merged 1 commit into
moby:20.10from
AkihiroSuda:dind-fix-cgroup2-evac-2010

Conversation

@AkihiroSuda

Copy link
Copy Markdown
Member

Cherry-pick #42331


- What I did

Fix docker-library/docker#308

- How I did it
Evacuate all the processes in /sys/fs/cgroup/cgroup.procs, not just PID 1.

- How to verify it

Before:

$ docker run --rm --privileged --init $(docker build -q .) cat /sys/fs/cgroup/cgroup.subtree_control
sed: couldn't flush stdout: Device or resource busy

After:

$ docker run --rm --privileged --init $(docker build -q .) cat /sys/fs/cgroup/cgroup.subtree_control
cpuset cpu io memory hugetlb pids rdma

Evacuate all the processes in `/sys/fs/cgroup/cgroup.procs`, not just PID 1.

Before:
```console
$ docker run --rm --privileged --init $(docker build -q .) cat /sys/fs/cgroup/cgroup.subtree_control
sed: couldn't flush stdout: Device or resource busy
```

After:
```console
$ docker run --rm --privileged --init $(docker build -q .) cat /sys/fs/cgroup/cgroup.subtree_control
cpuset cpu io memory hugetlb pids rdma
```

Fix docker-library/docker issue 308

Signed-off-by: Akihiro Suda <[email protected]>
(cherry picked from commit 42b1175)
Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda
AkihiroSuda requested a review from tianon as a code owner April 30, 2021 10:09
@AkihiroSuda AkihiroSuda added area/cgroup2 cgroup v2 kind/bugfix PR's that fix bugs labels Apr 30, 2021
@thaJeztah thaJeztah added this to the 20.10.7 milestone Apr 30, 2021

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tianon tianon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@tianon

tianon commented Apr 30, 2021

Copy link
Copy Markdown
Member

(CI failures look unrelated)

@tianon
tianon merged commit 114310d into moby:20.10 Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cgroup2 cgroup v2 kind/bugfix PR's that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants