Skip to content

Commit

Permalink
fix empty hugepages in some numa nodes caused no such file or directo…
Browse files Browse the repository at this point in the history
…ry error

Signed-off-by: lizhun <lizhun@kylinos.cn>
  • Loading branch information
kylinlizhun committed Aug 7, 2023
1 parent e0f10a8 commit d4d6fc9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/utils/memory_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ func GetNumaMemoryResources() (NumaMemoryResources, error) {
info[corev1.ResourceMemory] = nodeTotalMemory

// Get hugepages
hugepageBytes, err := getHugepagesBytes(filepath.Join(sysBusNodeBasepath, numaNode, "hugepages"))
hugePagePath := filepath.Join(sysBusNodeBasepath, numaNode, "hugepages")
_, err = os.Stat(hugePagePath)
if err != nil && os.IsNotExist(err) {
continue
}
hugepageBytes, err := getHugepagesBytes(hugePagePath)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit d4d6fc9

Please sign in to comment.