mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
libct/cg/fs2: fix GetStats for unsupported hugetlb
In case hugetlb is not supported, GetStats() should not error out, and yet it does. Assume that if GetHugePageSize return an error, hugetlb is not supported (this is what cgroup v1 manager do). Fixes:89a87adbSigned-off-by: Kir Kolyshkin <kolyshkin@gmail.com> (cherry picked from commit916c6a1539) Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
committed by
Akihiro Suda
parent
3125814f48
commit
8e96a96ff5
@@ -30,10 +30,7 @@ func setHugeTlb(dirPath string, r *configs.Resources) error {
|
||||
}
|
||||
|
||||
func statHugeTlb(dirPath string, stats *cgroups.Stats) error {
|
||||
hugePageSizes, err := cgroups.GetHugePageSize()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to fetch hugetlb info")
|
||||
}
|
||||
hugePageSizes, _ := cgroups.GetHugePageSize()
|
||||
hugetlbStats := cgroups.HugetlbStats{}
|
||||
|
||||
for _, pagesize := range hugePageSizes {
|
||||
|
||||
Reference in New Issue
Block a user