On Thu, Apr 20, 2017 at 2:19 AM, Yigal Korman <[email protected]> wrote: > Hi everyone, > > I have an interesting issue with DAX and KVM - I'm trying to boot a VM > with its memory mapped to a DAX-mounted file (kernel 4.9). > > The use case is a bit wacky but I'm trying to recreate something > similar to what clearlinux[1] described (although they don't use this > method anymore). > > When mapping the memory to a regular ext4 file, the VM boots fine. > But when mapping to ext4+dax, the VM won't boot or perhaps boots > extremely slowly. > In both cases the FS is on a memory pmem device. > > Here's a snippet of how I load things: > > mkfs.ext4 /dev/pmem0 > mount /dev/pmem0 /mnt > fallocate -l 512M /mnt/mem
I wonder if you replace this with "dd if=/dev/zero of=/mnt/mem bs=1024k count=512" if it changes the behavior. DAX forces synchronous block allocations and unwritten-extent-zeroing that get skipped in the page cache case. > qemu-system-x86_64 -nodefconfig -nodefaults \ > -drive if=virtio,file=centos7.qcow2,index=0,media=disk \ > --enable-kvm -serial telnet:localhost:4443,server,nowait \ > -device sga -m 512 -smp 1,sockets=1,cores=1,threads=1 \ > -object > memory-backend-file,prealloc=yes,mem-path=/mnt/mem,share=on,size=512M,id=ram > \ > -numa node,nodeid=0,cpus=0,memdev=ram \ > -net nic,model=virtio,vlan=0 \ > -net user,vlan=0,hostname=vm,hostfwd=tcp:127.0.0.1:8001-:22 \ > -name test -monitor telnet:localhost:4444,server,nowait > > I use a headless host so I usually connect to the VM with 'telnet > localhost 4443'. > > The above works and the VM boots in seconds. > When adding '-o dax' to the mount command, I can catch the grub menu > during boot but it gets stuck. > Sometimes if I wait about 20 minutes, I see some kernel boot messages > appear, but no errors. > > Any thoughts? > > Regards, > Yigal > > [1] https://lwn.net/Articles/644675/ > _______________________________________________ > Linux-nvdimm mailing list > [email protected] > https://lists.01.org/mailman/listinfo/linux-nvdimm _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
