MCPcopy Create free account
hub / github.com/containerd/cgroups / defaults

Function defaults

cgroup1/utils.go:36–66  ·  view source on GitHub ↗

defaults returns all known groups

(root string)

Source from the content-addressed store, hash-verified

34
35// defaults returns all known groups
36func defaults(root string) ([]Subsystem, error) {
37 h, err := NewHugetlb(root)
38 if err != nil && !os.IsNotExist(err) {
39 return nil, err
40 }
41 s := []Subsystem{
42 NewNamed(root, "systemd"),
43 NewFreezer(root),
44 NewPids(root),
45 NewNetCls(root),
46 NewNetPrio(root),
47 NewPerfEvent(root),
48 NewCpuset(root),
49 NewCpu(root),
50 NewCpuacct(root),
51 NewMemory(root),
52 NewBlkio(root),
53 NewRdma(root),
54 }
55 // only add the devices cgroup if we are not in a user namespace
56 // because modifications are not allowed
57 if !userns.RunningInUserNS() {
58 s = append(s, NewDevices(root))
59 }
60 // add the hugetlb cgroup if error wasn't due to missing hugetlb
61 // cgroup support on the host
62 if err == nil {
63 s = append(s, h)
64 }
65 return s, nil
66}
67
68// remove will remove a cgroup path handling EAGAIN and EBUSY errors and
69// retrying the remove after a exp timeout

Callers 3

DefaultFunction · 0.85
SystemdFunction · 0.85
newMockFunction · 0.85

Calls 14

NewHugetlbFunction · 0.85
NewNamedFunction · 0.85
NewFreezerFunction · 0.85
NewPidsFunction · 0.85
NewNetClsFunction · 0.85
NewNetPrioFunction · 0.85
NewPerfEventFunction · 0.85
NewCpusetFunction · 0.85
NewCpuFunction · 0.85
NewCpuacctFunction · 0.85
NewMemoryFunction · 0.85
NewBlkioFunction · 0.85

Tested by 1

newMockFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…