diff --git a/sysfs/system_cpu.go b/sysfs/system_cpu.go index 0c827f7f..11243b46 100644 --- a/sysfs/system_cpu.go +++ b/sysfs/system_cpu.go @@ -16,11 +16,13 @@ package sysfs import ( + "errors" "fmt" "os" "path/filepath" "strconv" "strings" + "syscall" "golang.org/x/sync/errgroup" @@ -281,9 +283,12 @@ func parseCpufreqCpuinfo(cpuPath string) (*SystemCPUCpufreqStats, error) { uintOut := make([]*uint64, len(uintFiles)) for i, f := range uintFiles { - v, err := parsers.ReadUintFromFile(filepath.Join(cpuPath, f)) + // os.ReadFile would park forever in the netpoller if the read returns + // EAGAIN, which cpuinfo_avg_freq does on arm64 when every CPU in the + // policy is idle. Treat that as the value being unavailable. + v, err := parsers.SysReadUintFromFile(filepath.Join(cpuPath, f)) if err != nil { - if os.IsNotExist(err) || os.IsPermission(err) { + if os.IsNotExist(err) || os.IsPermission(err) || errors.Is(err, syscall.EAGAIN) { continue } return &SystemCPUCpufreqStats{}, err