Skip to content

Commit

Permalink
cgroup2: only enable the cpuset controller if cpus or mems is specified
Browse files Browse the repository at this point in the history
Signed-off-by: jerryzhuang <zhuangqhc@gmail.com>
  • Loading branch information
zhuangqh committed May 8, 2023
1 parent dcd0bca commit 46d9229
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cgroup2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ func (r *Resources) Values() (o []Value) {
func (r *Resources) EnabledControllers() (c []string) {
if r.CPU != nil {
c = append(c, "cpu")
c = append(c, "cpuset")
if r.CPU.Cpus != "" || r.CPU.Mems != "" {
c = append(c, "cpuset")
}
}
if r.Memory != nil {
c = append(c, "memory")
Expand Down

0 comments on commit 46d9229

Please sign in to comment.