On Thu, 2020-06-04 at 12:33 +0200, Igor Mammedov wrote: > On Thu, 28 May 2020 16:34:36 -0600 > Vishal Verma <vishal.l.ve...@intel.com> wrote: > > > NVDIMMs can belong to their own proximity domains, as described by the > > NFIT. In such cases, the SRAT needs to have Memory Affinity structures > > in the SRAT for these NVDIMMs, otherwise Linux doesn't populate node > > data structures properly during NUMA initialization. See the following > > for an example failure case. > > > > https://lore.kernel.org/linux-nvdimm/20200416225438.15208-1-vishal.l.ve...@intel.com/ > > > > Introduce a new helper, nvdimm_build_srat(), and call it for both the > > i386 and arm versions of 'build_srat()' to augment the SRAT with > > memory affinity information for NVDIMMs. > > > > The relevant command line options to exercise this are below. Nodes 0-1 > > contain CPUs and regular memory, and nodes 2-3 are the NVDIMM address > > space. > > > > -numa node,nodeid=0,mem=2048M, > > -numa node,nodeid=1,mem=2048M, > > pls note that 'mem' is about to be disabled for new machine types in favor of > memdev > so this CLI won't work. > It would be nice to update commit message with memdev variant of CLI
I saw the warnings printed - I did try to use memdevs, but it didn't quite work with my use case. I'm supplying mem=0 for the pmem/nvdimm devices that I want to give a specific numa node, but not give them any more regular memory aside from the nvdimm itself (see nodes 4 and 5 below). And for some reason I couldn't do that with memdevs. Here is the full command line I'm using for example. I'd appreciate any pointers on converting over to memdevs fully. qemu-system-x86_64 -machine pc,accel=kvm,nvdimm, -m 8192M,slots=4,maxmem=40960M -smp 8,sockets=2,cores=2,threads=2 -enable-kvm -display none -nographic -drive file=root.img,format=raw,media=disk -kernel ./mkosi.extra/boot/vmlinuz-5.7.0-00001-g87ad963bac23 -initrd mkosi.extra/boot/initramfs-5.7.0-00001-g87ad963bac23.img -append selinux=0 audit=0 console=tty0 console=ttyS0 root=/dev/sda2 ignore_loglevel rw -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::10022-:22 -snapshot -numa node,nodeid=0,mem=2048M, -numa cpu,node-id=0,socket-id=0 -numa node,nodeid=1,mem=2048M, -numa cpu,node-id=1,socket-id=1 -numa node,nodeid=2,mem=2048M, -numa node,nodeid=3,mem=2048M, -numa node,nodeid=4,mem=0, -object memory-backend-file,id=nvmem0,share,mem-path=nvdimm-0,size=16384M,align=1G -device nvdimm,memdev=nvmem0,id=nv0,label-size=2M,node=4 -numa node,nodeid=5,mem=0, -object memory-backend-file,id=nvmem1,share,mem-path=nvdimm-1,size=16384M,align=1G -device nvdimm,memdev=nvmem1,id=nv1,label-size=2M,node=5 > > > -numa node,nodeid=2,mem=0, > > -object > > memory-backend-file,id=nvmem0,share,mem-path=nvdimm-0,size=16384M,align=128M > > -device nvdimm,memdev=nvmem0,id=nv0,label-size=2M,node=2 > > -numa node,nodeid=3,mem=0, > > -object > > memory-backend-file,id=nvmem1,share,mem-path=nvdimm-1,size=16384M,align=128M > > -device nvdimm,memdev=nvmem1,id=nv1,label-size=2M,node=3 > > > > Cc: Jingqi Liu <jingqi....@intel.com> > > Cc: Michael S. Tsirkin <m...@redhat.com> > > Reviewed-by: Jingqi Liu <jingqi....@intel.com> > > Signed-off-by: Vishal Verma <vishal.l.ve...@intel.com> > > Reviewed-by: Igor Mammedov <imamm...@redhat.com> Thanks for the review Igor - I'm pretty unfamiliar with qemu development - what are the next steps? Is there a certain maintainer/tree I could watch for the inclusion of this? > > > --- > > hw/acpi/nvdimm.c | 23 +++++++++++++++++++++++ > > hw/arm/virt-acpi-build.c | 4 ++++ > > hw/i386/acpi-build.c | 5 +++++ > > include/hw/mem/nvdimm.h | 1 + > > 4 files changed, 33 insertions(+) > > > >