All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linhaifeng <haifeng.lin@huawei.com>
To: qemu-devel@nongnu.org
Cc: liuyongan@huawei.com, lilijun <jerry.lilijun@huawei.com>,
	"n.nikolaev@virtualopensystems.com >> Nikolay Nikolaev"
	<n.nikolaev@virtualopensystems.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] vhost-user:How to send memory info
Date: Fri, 12 Dec 2014 12:45:23 +0800	[thread overview]
Message-ID: <548A72E3.4090201@huawei.com> (raw)
In-Reply-To: <54890B3F.7010306@huawei.com>


here is qemu's log :
file_ram_alloc filename[/dev/hugepages/libvirt/qemu/qemu_back_mem._objects_ram-node0.okpjmP] fd[7] size[1073741824]
file_ram_alloc filename[/dev/hugepages/libvirt/qemu/qemu_back_mem._objects_ram-node1.3b43YF] fd[8] size[1073741824]

	region fd[7]:
        gpa = 0xC0000
        size = 2146697216
        ua = 0x2aaaaacc0000
        offset = 786432

        region fd[7]:
        gpa = 0x0
        size = 655360
        ua = 0x2aaaaac00000
        offset = 0

we can see memory region only contain one hugepage.Is this a bug?

On 2014/12/11 11:10, Linhaifeng wrote:
> Hi,all
> 
> Yestoday i tested the set_mem_table message found that qemu not send all the memory info(fd and size) when
> VM memory size is 2G and have two numa nodes(two hugepage files).If VM memory size is 4G and have two numa nodes
> will send all the memory info.
> 
> Here is my understand,is this right?
> If qemu not send all the memory infomation about hugepage files,vhost-user couldn't map all the VM memory.
> If vhost-user couldn't map all the VM memory vhost-user maybe couldn't read the packets which allocate by Guest.
> 
> 
> 1.Information about VM who has 2G and two numa nodes(vhost-user couldn't read the packets from tx_ring of Guest):
> xml:
>   <cpu>
>     <numa>
>       <cell id='0' cpus='0' memory='1048576' memAccess='shared'/>
>       <cell id='1' cpus='1' memory='1048576' memAccess='shared'/>
>     </numa>
>   </cpu>
>  <memoryBacking>
>     <hugepages>
>       <page size="2" unit="M" nodeset="0,1"/>
>     </hugepages>
>  </memoryBacking>
>  <interface type='vhostuser'>
>     <mac address='52:54:00:3b:83:1a'/>
>     <source type='unix' path='/var/run/vhost-user/port1' mode='client'/>
>     <model type='virtio'/>
>  </interface>
> 
> qemu command:
> -m 2048 -smp 2,sockets=2,cores=1,threads=1
> -object memory-backend-file,prealloc=yes,mem-path=/dev/hugepages/libvirt/qemu,share=on,size=1024M,id=ram-node0 -numa node,nodeid=0,cpus=0,memdev=ram-node0
> -object memory-backend-file,prealloc=yes,mem-path=/dev/hugepages/libvirt/qemu,share=on,size=1024M,id=ram-node1 -numa node,nodeid=1,cpus=1,memdev=ram-node1
> 
> 
> memory regions:
>         gpa = 0xC0000
>         size = 2146697216
>         ua = 0x2aaaaacc0000
>         offset = 786432
> 
>         gpa = 0x0
>         size = 655360
>         ua = 0x2aaaaac00000
>         offset = 0
> 
> hugepage:
> cat /proc/pidof qemu/maps
> 2aaaaac00000-2aaaeac00000 rw-s 00000000 00:18 10357788                   /dev/hugepages/libvirt/qemu/qemu_back_mem._objects_ram-node0.MvcPyi (deleted)
> 2aaaeac00000-2aab2ac00000 rw-s 00000000 00:18 10357789                   /dev/hugepages/libvirt/qemu/qemu_back_mem._objects_ram-node1.tjAVin (deleted)
> 
> The memory size of each region is not match to the size of each hugepage file,is this ok?How does vhost-user to mmap all the hugepage?
> 
> 2.Information about VM who has 4G and two numa nodes(vhost-user could read the packets from tx_ring of Guest):
> xml:
>   <cpu>
>     <numa>
>       <cell id='0' cpus='0' memory='2097152' memAccess='shared'/>
>       <cell id='1' cpus='1' memory='2097152' memAccess='shared'/>
>     </numa>
>   </cpu>
> 
>  <memoryBacking>
>     <hugepages>
>       <page size="2" unit="M" nodeset="0,1"/>
>     </hugepages>
>  </memoryBacking>
> 
> qemu command:
> -m 4096 -smp 2,sockets=2,cores=1,threads=1
> -object memory-backend-file,prealloc=yes,mem-path=/dev/hugepages/libvirt/qemu,share=on,size=2048M,id=ram-node0 -numa node,nodeid=0,cpus=0,memdev=ram-node0
> -object memory-backend-file,prealloc=yes,mem-path=/dev/hugepages/libvirt/qemu,share=on,size=2048M,id=ram-node1 -numa node,nodeid=1,cpus=1,memdev=ram-node1
> 
> memory regions:
>         gpa = 0xC0000
>         size = 3220439040
>         ua = 0x2aaaaacc0000
>         offset = 786432
> 
>         gpa = 0x100000000
>         size = 1073741824
>         ua = 0x2aab6ac00000
>         offset = 1073741824
> 
>         gpa = 0x0
>         size = 655360
>         ua = 0x2aaaaac00000
>         offset = 0
> 
> hugepage:
> cat /proc/pidof qemu/maps
> 2aaaaac00000-2aab2ac00000 rw-s 00000000 00:18 10756623                   /dev/hugepages/libvirt/qemu/qemu_back_mem._objects_ram-node0.If4Qkf (deleted)
> 2aab2ac00000-2aabaac00000 rw-s 00000000 00:18 10756624                   /dev/hugepages/libvirt/qemu/qemu_back_mem._objects_ram-node1.jQZPcI (deleted)
> 

-- 
Regards,
Haifeng

      parent reply	other threads:[~2014-12-12  4:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11  3:10 [Qemu-devel] How to send memory info Linhaifeng
2014-12-11  4:59 ` [Qemu-devel] vhost_user: " Linhaifeng
2014-12-12  4:45 ` Linhaifeng [this message]

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=548A72E3.4090201@huawei.com \
    --to=haifeng.lin@huawei.com \
    --cc=jerry.lilijun@huawei.com \
    --cc=liuyongan@huawei.com \
    --cc=mst@redhat.com \
    --cc=n.nikolaev@virtualopensystems.com \
    --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 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.