Skip to content

Commit

Permalink
Merge pull request #4018 from jrife/main
Browse files Browse the repository at this point in the history
Handle kmem.limit_in_bytes removal
  • Loading branch information
AkihiroSuda committed Sep 25, 2023
2 parents f235fa6 + 99469eb commit a32ad76
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libcontainer/cgroups/fs/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ func getMemoryData(path, name string) (cgroups.MemoryData, error) {
memoryData.Failcnt = value
value, err = fscommon.GetCgroupParamUint(path, limit)
if err != nil {
if name == "kmem" && os.IsNotExist(err) {
// Ignore ENOENT as kmem.limit_in_bytes has
// been removed in newer kernels.
return memoryData, nil
}

return cgroups.MemoryData{}, err
}
memoryData.Limit = value
Expand Down

0 comments on commit a32ad76

Please sign in to comment.