Skip to content

Commit

Permalink
simplify cgroup controller separation (zeromicro#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan authored Jan 13, 2021
1 parent 8d6f6f9 commit 744c18b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/stat/internal/cgroup_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,11 @@ func currentCgroup() (*cgroup, error) {
continue
}

if strings.Contains(subsys, ",") {
for _, k := range strings.Split(subsys, ",") {
cgroups[k] = path.Join(cgroupDir, k)
}
} else {
cgroups[subsys] = path.Join(cgroupDir, subsys)
// https://man7.org/linux/man-pages/man7/cgroups.7.html
// comma-separated list of controllers for cgroup version 1
fields := strings.Split(subsys, ",")
for _, val := range fields {
cgroups[val] = path.Join(cgroupDir, val)
}
}

Expand Down

0 comments on commit 744c18b

Please sign in to comment.