diff options
author | Ahmad Sherif <ahmad@gitlab.com> | 2022-03-24 16:03:45 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2022-03-24 16:10:26 +0300 |
commit | 57d2cc329bf5a5efe9d80f748ae102545c7ba2ff (patch) | |
tree | 09cb81d98db1742929ef812aebf47393259464e6 | |
parent | e302aa4a8caf07caad38c236d610fea49a41aa2f (diff) |
cgroups: Allow stats to be collected in absence of memsw.* entries
Otherwise, we get errors such as
`open /sys/fs/cgroup/memory/gitaly/gitaly-1/memory.memsw.usage_in_bytes:
no such file or directory`.
Changelog: fixed
-rw-r--r-- | internal/cgroups/v1_linux.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/cgroups/v1_linux.go b/internal/cgroups/v1_linux.go index e524d7609..d98a75807 100644 --- a/internal/cgroups/v1_linux.go +++ b/internal/cgroups/v1_linux.go @@ -181,7 +181,7 @@ func (cg *CGroupV1Manager) currentProcessCgroup() string { func defaultSubsystems(root string) ([]cgroups.Subsystem, error) { subsystems := []cgroups.Subsystem{ - cgroups.NewMemory(root), + cgroups.NewMemory(root, cgroups.OptionalSwap()), cgroups.NewCpu(root), } |