jaypipes / ghw

Go HardWare discovery/inspection library
Apache License 2.0
1.62k stars 174 forks source link

assume phys mem == usable mem on ARM #337

Closed jaypipes closed 1 year ago

jaypipes commented 1 year ago

/sys/devices/system/memory does not exist on linux/arm systems that do not support memory hotplug. This means that the /sys/devices/system/memory/block_size_bytes file also does not exist and that is the file that we use to determine the physical RAM associated with a RAM module affined to a NUMA node.

This commit updates the logic in pkg/memory.AreaForNode on linux platforms to tolerate the error returned by memoryBlockSizeBytes() when /sys/devices/system/memory/block_size_bytes does not exist and set a memory Area's TotalPhysicalBytes value to the value of TotalUsableBytes.

Issue #336

jaypipes commented 1 year ago

@ffromani any chance you have some time to review this one? :)

ffromani commented 1 year ago

@ffromani any chance you have some time to review this one? :)

done and merged!