Skip to content

Commit 474049b

Browse files
authored
Merge pull request #293 from zhuangqh/fix/v2-cpuset-ctrl
cgroup2: only enable the cpuset controller if cpus or mems is specified
2 parents dcd0bca + 46d9229 commit 474049b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cgroup2/manager.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ func (r *Resources) Values() (o []Value) {
9696
func (r *Resources) EnabledControllers() (c []string) {
9797
if r.CPU != nil {
9898
c = append(c, "cpu")
99-
c = append(c, "cpuset")
99+
if r.CPU.Cpus != "" || r.CPU.Mems != "" {
100+
c = append(c, "cpuset")
101+
}
100102
}
101103
if r.Memory != nil {
102104
c = append(c, "memory")

0 commit comments

Comments
 (0)