From: "Marc-André Lureau" <mlureau@redhat.com>
To: Pavel Fedin <p.fedin@samsung.com>
Cc: marcandre lureau <marcandre.lureau@redhat.com>,
qemu-devel@nongnu.org, peter maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PULL 00/48] ivshmem series
Date: Fri, 9 Oct 2015 08:12:42 -0400 (EDT) [thread overview]
Message-ID: <1502097065.27700614.1444392762627.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <015601d10289$6f487650$4dd962f0$@samsung.com>
Hi
----- Original Message -----
> Hello!
>
> I have merged this PULL into our local repository and my colleague gave it a
> try.
> It seems to work, but looks like ivshmem + memdev + hugetlbfs doesn't do the
> right thing. Memdev does attach itself to a hugetlb, but we cannot actually
> share data with it.
> Our command line was:
> --- cut ---
> /usr/local/bin/qemu-system-aarch64 \
> -name ivshmem1_huge \
> -machine virt,accel=kvm,usb=off,gic-version=3 \
> -cpu host -m 2048 \
> -realtime mlock=off \
> -smp 8,sockets=8,cores=1,threads=1 \
> -nographic \
> -kernel /var/lib/libvirt/images/Image_uio \
> -append console='ttyAMA0,115200n8 root=/dev/sda4 rootwait
> hugepages=128 earlycon=pl011,0x9000000' \
> -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \
> -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \
> -device virtio-scsi-pci,id=scsi0,bus=pci.2,addr=0x1 \
> -drive
> file=/var/lib/libvirt/images/sda3_pool/ivshmem1_huge.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2
> \
> -device
> scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1
> \
> -object
> memory-backend-file,size=4G,mem-path=/dev/huge,id=mb1,share=on \
> -device ivshmem,memdev=mb1 \
> -msg timestamp=on
> --- cut ---
>
> The problem is that memdev creates a file as temporary, and then immediately
> unlinks it. Therefore, we cannot feed the same file to another VM. These
> are open files, used by two running VMs, which are supposed to exchange
> data via ivshmem.
> --- cut ---
> [root@thunderx-2 igor]# ls -l /proc/34845/fd
> total 0
> lrwx------ 1 root root 64 Oct 9 06:59 0 -> /dev/pts/2
> lrwx------ 1 root root 64 Oct 9 06:59 1 -> /dev/pts/2
> ...
> lrwx------ 1 root root 64 Oct 9 06:59 7 -> anon_inode:[eventfd]
> lrwx------ 1 root root 64 Oct 9 06:59 8 ->
> /dev/huge/qemu_back_mem._objects_mb1.lwEeDc (deleted)
> lrwx------ 1 root root 64 Oct 9 06:59 9 -> /dev/kvm
> [root@thunderx-2 igor]# ls -l /proc/34866/fd
> total 0
> lrwx------ 1 root root 64 Oct 9 06:59 0 -> /dev/pts/0
> lrwx------ 1 root root 64 Oct 9 06:59 1 -> /dev/pts/0
> ...
> lrwx------ 1 root root 64 Oct 9 06:59 7 -> anon_inode:[eventfd]
> lrwx------ 1 root root 64 Oct 9 06:59 8 ->
> /dev/huge/qemu_back_mem._objects_mb1.0Myp8M (deleted)
> lrwx------ 1 root root 64 Oct 9 06:59 9 -> /dev/kvm
> --- cut ---
> Due to the same reason, we cannot also exchange data between host and VM.
> Is it a flaw or do we just do something wrong?
file_ram_alloc() only allocates with temporary files, even when using share=true.
We could teach it to use an existing file instead. This is an additional feature that could be considered after this series, since it's not a regression. Also, the prefered way to share memory (including hugetlb) is to use the ivshmem-server (that way you have a clear owner, and you can signal vm2vm).
> Tested-by: Igor Skalkin <i.skalkin@samsung.com>
Thanks a lot for testing.
>
> Kind regards,
> Pavel Fedin
> Expert Engineer
> Samsung Electronics Research center Russia
>
>
>
next prev parent reply other threads:[~2015-10-09 12:12 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 19:18 [Qemu-devel] [PULL 00/48] ivshmem series marcandre.lureau
2015-10-06 19:18 ` [Qemu-devel] [PULL 01/48] char: add qemu_chr_free() marcandre.lureau
2015-10-06 19:18 ` [Qemu-devel] [PULL 02/48] msix: add VMSTATE_MSIX_TEST marcandre.lureau
2015-10-06 19:18 ` [Qemu-devel] [PULL 03/48] ivhsmem: read do not accept more than sizeof(long) marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 04/48] ivshmem: fix number of bytes to push to fifo marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 05/48] ivshmem: factor out the incoming fifo handling marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 06/48] ivshmem: remove unnecessary dup() marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 07/48] ivshmem: remove superflous ivshmem_attr field marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 08/48] ivshmem: remove useless doorbell field marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 09/48] ivshmem: more qdev conversion marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 10/48] ivshmem: remove last exit(1) marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 11/48] ivshmem: limit maximum number of peers to G_MAXUINT16 marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 12/48] ivshmem: simplify around increase_dynamic_storage() marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 13/48] ivshmem: allocate eventfds in resize_peers() marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 14/48] ivshmem: remove useless ivshmem_update_irq() val argument marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 15/48] ivshmem: initialize max_peer to -1 marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 16/48] ivshmem: remove max_peer field marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 17/48] ivshmem: improve debug messages marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 18/48] ivshmem: improve error handling marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 19/48] ivshmem: print error on invalid peer id marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 20/48] ivshmem: simplify a bit the code marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 21/48] ivshmem: use common return marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 22/48] ivshmem: use common is_power_of_2() marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 23/48] ivshmem: migrate with VMStateDescription marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 24/48] ivshmem: shmfd can be 0 marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 25/48] ivshmem: check shm isn't already initialized marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 26/48] ivshmem: add device description marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 27/48] ivshmem: fix pci_ivshmem_exit() marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 28/48] ivshmem: replace 'guest' for 'peer' appropriately marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 29/48] ivshmem: error on too many eventfd received marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 30/48] ivshmem: reset mask on device reset marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 31/48] contrib: add ivshmem client and server marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 32/48] ivshmem-client: check the number of vectors marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 33/48] ivshmem-server: use a uint16 for client ID marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 34/48] ivshmem-server: fix hugetlbfs support marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 35/48] docs: update ivshmem device spec marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 36/48] ivshmem: add check on protocol version in QEMU marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 37/48] contrib: remove unnecessary strdup() marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 38/48] msix: implement pba write (but read-only) marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 39/48] qtest: add qtest_add_abrt_handler() marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 40/48] glib-compat: add 2.38/2.40/2.46 asserts marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 41/48] tests: add ivshmem qtest marcandre.lureau
2015-10-10 21:29 ` Michael Roth
2015-10-12 13:53 ` Marc-André Lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 42/48] ivshmem: do not keep shm_fd open marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 43/48] ivshmem: use qemu_strtosz() marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 44/48] ivshmem: add hostmem backend marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 45/48] ivshmem: remove EventfdEntry.vector marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 46/48] ivshmem: rename MSI eventfd_table marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 47/48] ivshmem: use kvm irqfd for msi notifications marcandre.lureau
2015-10-06 19:19 ` [Qemu-devel] [PULL 48/48] ivshmem: use little-endian int64_t for the protocol marcandre.lureau
2015-10-07 12:11 ` [Qemu-devel] [PULL 00/48] ivshmem series Andreas Färber
2015-10-07 12:16 ` Marc-André Lureau
2015-10-07 12:31 ` Andreas Färber
2015-10-07 12:44 ` Marc-André Lureau
2015-10-10 22:18 ` [Qemu-devel] [PATCH 1/2] tests: Add ivshmem qtest Andreas Färber
2015-10-10 22:18 ` [Qemu-devel] [PATCH 2/2] ivshmem-test: Implement tests Andreas Färber
2015-10-10 22:28 ` Andreas Färber
2015-10-10 23:10 ` [Qemu-devel] [PATCH 1/2] tests: Add ivshmem qtest Marc-André Lureau
2015-10-07 22:24 ` [Qemu-devel] [PULL 00/48] ivshmem series Paolo Bonzini
2015-10-07 12:42 ` Andrew Jones
2015-10-07 13:05 ` Andreas Färber
2015-10-07 13:26 ` Marc-André Lureau
2015-10-07 22:00 ` Peter Maydell
2015-10-09 11:55 ` Pavel Fedin
2015-10-09 12:12 ` Marc-André Lureau [this message]
2015-10-09 12:29 ` Pavel Fedin
2015-10-09 12:45 ` Marc-André Lureau
2015-10-09 12:47 ` Paolo Bonzini
2015-10-09 13:02 ` Pavel Fedin
2015-10-09 13:07 ` Paolo Bonzini
2015-10-09 12:51 ` Pavel Fedin
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=1502097065.27700614.1444392762627.JavaMail.zimbra@redhat.com \
--to=mlureau@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=p.fedin@samsung.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).