All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Yigal Korman <yigal@plexistor.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: qemu-kvm hangs with DAX
Date: Thu, 20 Apr 2017 06:23:18 -0700	[thread overview]
Message-ID: <CAPcyv4hi2DicbTR3-m735jhP=mdMU+QMZY-9FP+eXU7VFuV79A@mail.gmail.com> (raw)
In-Reply-To: <CACTTzNaOc2K5tgfbp-zfr=C9Xd2s1g-9y6rXiNbjPH9iK-HsWw@mail.gmail.com>

On Thu, Apr 20, 2017 at 2:19 AM, Yigal Korman <yigal@plexistor.com> 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
> Linux-nvdimm@lists.01.org
> https://lists.01.org/mailman/listinfo/linux-nvdimm
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2017-04-20 13:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20  9:19 qemu-kvm hangs with DAX Yigal Korman
2017-04-20 13:23 ` Dan Williams [this message]
2017-04-23 14:20   ` Yigal Korman
2017-04-24  6:16 Yigal Korman
2017-04-26 13:43 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPcyv4hi2DicbTR3-m735jhP=mdMU+QMZY-9FP+eXU7VFuV79A@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=yigal@plexistor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.