qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] vhost_user: How to send memory info


From: Linhaifeng
Subject: [Qemu-devel] vhost_user: How to send memory info
Date: Thu, 11 Dec 2014 12:59:18 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.0


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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]