Closed honggyukim closed 8 months ago
The qemu was started with the following command.
$ sudo qemu-system-x86_64 \
-enable-kvm -nographic \
-kernel ./arch/x86_64/boot/bzImage \
-hda core-image-sato-sdk-qemux86-64.ext4 \
-append "nokaslr root=/dev/sda console=ttyS0" \
-device e1000,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::5002-:22 \
-cpu host -smp cpus=4 \
-m 8G \
-object memory-backend-ram,size=2G,id=ram0 \
-object memory-backend-ram,size=6G,id=ram1 \
-numa node,nodeid=0,memdev=ram0,cpus=0-3 \
-numa node,nodeid=1,memdev=ram1
Thank you for reporting. Will take a look soon.
There is no memory directory inside /sys/devices/system/ in the system.
The /sys/devices/system/memory
is created at https://github.com/torvalds/linux/blob/v6.6-rc4/drivers/base/memory.c#L940 as follows.
/*
* Initialize the sysfs support for memory devices. At the time this function
* is called, we cannot have concurrent creation/deletion of memory block
* devices, the device_hotplug_lock is not needed.
*/
void __init memory_dev_init(void)
{
...
ret = subsys_system_register(&memory_subsys, memory_root_attr_groups);
...
}
However, it's only available when CONFIG_MEMORY_HOTPLUG
build config is enabled. I'm not sure if we really have to support this case.
I've just confirmed that enabling CONFIG_MEMORY_HOTPLUG
in my qemu shows the /sys/devices/system/memory/block_size_bytes
file.
Thank you for the nice finding. I'll make the code to handle the case with a proper error message.
Uploaded the fix. Please comment here or open another issue if it doesn't fix the case.
Hi SeongJae,
I have a numa system on qemu as follows.
In this machine, I see an error when using
--numa_node
option as follows.There is no
memory
directory inside/sys/devices/system/
in the system.So this edge case should also be handled properly.
The tested damo version is as follows.
The kernel version is as follows.