We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4cbc285 + 777a0cb commit 8a68de5Copy full SHA for 8a68de5
1 file changed
subsystem.go
@@ -18,6 +18,7 @@ package cgroups
18
19
import (
20
"fmt"
21
+ "os"
22
23
v1 "github.com/containerd/cgroups/stats/v1"
24
specs "github.com/opencontainers/runtime-spec/specs-go"
@@ -46,7 +47,6 @@ const (
46
47
// available on most linux systems
48
func Subsystems() []Name {
49
n := []Name{
- Hugetlb,
50
Freezer,
51
Pids,
52
NetCLS,
@@ -62,6 +62,9 @@ func Subsystems() []Name {
62
if !RunningInUserNS() {
63
n = append(n, Devices)
64
}
65
+ if _, err := os.Stat("/sys/kernel/mm/hugepages"); err == nil {
66
+ n = append(n, Hugetlb)
67
+ }
68
return n
69
70
0 commit comments