Closed wanyaoqi closed 10 months ago
Hi @wanyaoqi thanks for submitting this issue. You can turn off these warnings. For ARM, topology memory information may not be available due to platform limitations.
Hi @jaypipes , thanks for your reply. The problem is get numa node physical memory size, others topo info is works.
And i don't need numa node physical memory size actually, so i just paste usable size to physical size to workaround this problem. https://github.com/wanyaoqi/ghw/pull/1
Can we check /sys/devices/system/memory/block_size_bytes
file exists, if not exist return a inaccuracy value( usable size) or return -1 rather than return a error, because other numa topo infomation is work.
Hi @jaypipes , thanks for your reply. The problem is get numa node physical memory size, others topo info is works. And i don't need numa node physical memory size actually, so i just paste usable size to physical size to workaround this problem. wanyaoqi#1 Can we check
/sys/devices/system/memory/block_size_bytes
file exists, if not exist return a inaccuracy value( usable size) or return -1 rather than return a error, because other numa topo infomation is work.
@wanyaoqi we already do that :)
Hi @jaypipes , thanks for your reply. The problem is get numa node physical memory size, others topo info is works. And i don't need numa node physical memory size actually, so i just paste usable size to physical size to workaround this problem. wanyaoqi#1 Can we check
/sys/devices/system/memory/block_size_bytes
file exists, if not exist return a inaccuracy value( usable size) or return -1 rather than return a error, because other numa topo infomation is work.@wanyaoqi we already do that :)
@jaypipes Okay, but function AreaForNode
seems like not fixed ?
https://github.com/jaypipes/ghw/blob/227643e14380812d61b941f7aa52d1156b6d900a/pkg/memory/memory_linux.go#L60-L71
AreaForNode should call memTotalPhysicalBytes like this:
func AreaForNode(ctx *context.Context, nodeID int) (*Area, error) {
paths := linuxpath.New(ctx)
path := filepath.Join(
paths.SysDevicesSystemNode,
fmt.Sprintf("node%d", nodeID),
)
totPhys := memTotalPhysicalBytes(paths)
totUsable, err := memoryTotalUsableBytesFromPath(filepath.Join(path, "meminfo"))
if err != nil {
return nil, err
}
supportedHP, err := memorySupportedPageSizes(filepath.Join(path, "hugepages"))
if err != nil {
return nil, err
}
return &Area{
TotalPhysicalBytes: totPhys,
TotalUsableBytes: totUsable,
SupportedPageSizes: supportedHP,
}, nil
}
@wanyaoqi gotcha. I will push a fix shortly. :) thank you!
I guess this issue can be closed? 😄
topology.New()
will report: WARNING: failed to determine memory area for node: open /sys/devices/system/memory/block_size_bytes: no such file or directoryARM no /sys/devices/system/memory directory. As the this comment: https://github.com/kata-containers/runtime/issues/796#issuecomment-425393743 ARM not support memory hotplug,and i can't get physical memory from sysfs.
Is there any way around this problem