Skip to content

Commit 46d9229

Browse files
committed
cgroup2: only enable the cpuset controller if cpus or mems is specified
Signed-off-by: jerryzhuang <zhuangqhc@gmail.com>
1 parent dcd0bca commit 46d9229

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)