Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runc update error when there is a nested cpuset cgroup #1635

Open
Ace-Tang opened this issue Nov 2, 2017 · 3 comments · May be fixed by #3189
Open

runc update error when there is a nested cpuset cgroup #1635

Ace-Tang opened this issue Nov 2, 2017 · 3 comments · May be fixed by #3189

Comments

@Ace-Tang
Copy link
Contributor

Ace-Tang commented Nov 2, 2017

I try this command runc --root /run/containerd/runc/default/ update --cpuset-cpus "0,1" docker2, and get error

failed to write 0,1 to cpuset.cpus: write /sys/fs/cgroup/cpuset/default/docker2/cpuset.cpus: device or resource busy

this is because a nested cpuset cgroup existed, cause child cpusets must contain a subset of the parents CPU and Memory resources, so we cannot simply change the data in parent cgroup file.

this case occurs in a real business scene. here is my test environment, docker2 is a container cpuset cgroup, t1, t2, l1, l2, c3 is a nested cpuset cgroup.

root@www:/sys/fs/cgroup/cpuset/default/docker2# tree
...
├── cpuset.sched_load_balance
├── cpuset.sched_relax_domain_level
├── notify_on_release
├── t1
│   ...
│   ├── cpuset.memory_migrate
│   ├── cpuset.memory_pressure
│   ├── cpuset.memory_spread_page
│   ├── cpuset.memory_spread_slab
│   ├── cpuset.mems
│   ├── cpuset.sched_load_balance
│   ├── cpuset.sched_relax_domain_level
│   ├── l1
│   │   ├── cgroup.clone_children
│   │   ├── cgroup.procs
│   │   ├── cpuset.cpu_exclusive
│   │   ├── cpuset.cpus
│   │   ├── cpuset.effective_cpus
│   │   ├── cpuset.effective_mems
│   │   ├── cpuset.mem_exclusive
│   │   ├── cpuset.mem_hardwall
│   │   ├── cpuset.memory_migrate
│   │   ├── cpuset.memory_pressure
│   │   ├── cpuset.memory_spread_page
│   │   ├── cpuset.memory_spread_slab
│   │   ├── cpuset.mems
│   │   ├── cpuset.sched_load_balance
│   │   ├── cpuset.sched_relax_domain_level
│   │   ├── notify_on_release
│   │   └── tasks
│   ├── notify_on_release
│   └── tasks
├── t2
│    ...
│   ├── cpuset.memory_spread_slab
│   ├── cpuset.mems
│   ├── cpuset.sched_load_balance
│   ├── cpuset.sched_relax_domain_level
│   ├── l2
│   │   ├── c3
│   │   │   ├── cgroup.clone_children
│   │   │   ├── cgroup.procs
│   │   │   ├── cpuset.cpu_exclusive
│   │   │   ├── cpuset.cpus
│   │   │   ├── cpuset.effective_cpus
│   │   │   ├── cpuset.effective_mems
│   │   │   ├── cpuset.mem_exclusive
│   │   │   ├── cpuset.mem_hardwall
│   │   │   ├── cpuset.memory_migrate
│   │   │   ├── cpuset.memory_pressure
│   │   │   ├── cpuset.memory_spread_page
│   │   │   ├── cpuset.memory_spread_slab
│   │   │   ├── cpuset.mems
│   │   │   ├── cpuset.sched_load_balance
│   │   │   ├── cpuset.sched_relax_domain_level
│   │   │   ├── notify_on_release
│   │   │   └── tasks
│   │   ├── cgroup.clone_children
│   │   ├── cgroup.procs
│   │   ├── cpuset.cpu_exclusive
│   │   ├── cpuset.cpus
│   │   ├── cpuset.effective_cpus
│   │   ├── cpuset.effective_mems
│   │   ├── cpuset.mem_exclusive
│   │   ├── cpuset.mem_hardwall
│   │   ├── cpuset.memory_migrate
│   │   ├── cpuset.memory_pressure
│   │   ├── cpuset.memory_spread_page
│   │   ├── cpuset.memory_spread_slab
│   │   ├── cpuset.mems
│   │   ├── cpuset.sched_load_balance
│   │   ├── cpuset.sched_relax_domain_level
│   │   ├── notify_on_release
│   │   └── tasks
│   ├── notify_on_release
│   └── tasks
└── tasks
@P1ng-W1n
Copy link

P1ng-W1n commented Aug 2, 2018

Is there any update about this issue?
It was opened quite some time ago, but nobody seems to checked it yet.

@vladimir-kozyrev
Copy link

vladimir-kozyrev commented Apr 1, 2019

This issue affects quite a lot of people. Will there be a fix any time soon?
#66614 #54967

@omriperi
Copy link

Hey, any update on this issue?

askervin pushed a commit to askervin/runc that referenced this issue Aug 30, 2021
cpuset cgroup form a nested hierarchy visible in a virtual
file system, and child cpusets must contain a subset of the
parents CPU and Memory resources. When root user get permission
to make nested cpuset cgroup, this patch will allow update
operation in this case.

Fixes: opencontainers#1635

Signed-off-by: Ace-Tang <aceapril@126.com>
askervin pushed a commit to askervin/runc that referenced this issue Aug 30, 2021
cpuset cgroup form a nested hierarchy visible in a virtual
file system, and child cpusets must contain a subset of the
parents CPU and Memory resources. When root user get permission
to make nested cpuset cgroup, this patch will allow update
operation in this case.

Fixes: opencontainers#1635

Signed-off-by: Ace-Tang <aceapril@126.com>
askervin pushed a commit to askervin/runc that referenced this issue Aug 30, 2021
cpuset cgroup form a nested hierarchy visible in a virtual
file system, and child cpusets must contain a subset of the
parents CPU and Memory resources. When root user get permission
to make nested cpuset cgroup, this patch will allow update
operation in this case.

Fixes: opencontainers#1635

Signed-off-by: Ace-Tang <aceapril@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants