From a4ad3d4411cb43528ec6fc2b50a438203b3e2759 Mon Sep 17 00:00:00 2001 From: lizhun Date: Tue, 8 Aug 2023 15:14:44 +0800 Subject: [PATCH] fix empty hugepages in some numa nodes caused no such file or directory error Signed-off-by: lizhun --- pkg/utils/memory_resources.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/utils/memory_resources.go b/pkg/utils/memory_resources.go index c86ecb8eb..ab6447a75 100644 --- a/pkg/utils/memory_resources.go +++ b/pkg/utils/memory_resources.go @@ -69,7 +69,11 @@ func GetNumaMemoryResources() (NumaMemoryResources, error) { // Get hugepages hugepageBytes, err := getHugepagesBytes(filepath.Join(sysBusNodeBasepath, numaNode, "hugepages")) if err != nil { - return nil, err + if os.IsNotExist(err) { + continue + } else { + return nil, err + } } for n, s := range hugepageBytes { info[n] = s