qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] How to send memory info
@ 2014-12-11  3:10 Linhaifeng
  2014-12-11  4:59 ` [Qemu-devel] vhost_user: " Linhaifeng
  2014-12-12  4:45 ` [Qemu-devel] vhost-user:How " Linhaifeng
  0 siblings, 2 replies; 3+ messages in thread
From: Linhaifeng @ 2014-12-11  3:10 UTC (permalink / raw)
  To: qemu-devel
  Cc: liuyongan, lilijun,
	n.nikolaev@virtualopensystems.com >> Nikolay Nikolaev,
	Michael S. Tsirkin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] vhost_user: How to send memory info
  2014-12-11  3:10 [Qemu-devel] How to send memory info Linhaifeng
@ 2014-12-11  4:59 ` Linhaifeng
  2014-12-12  4:45 ` [Qemu-devel] vhost-user:How " Linhaifeng
  1 sibling, 0 replies; 3+ messages in thread
From: Linhaifeng @ 2014-12-11  4:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: liuyongan, lilijun,
	n.nikolaev@virtualopensystems.com >> Nikolay Nikolaev,
	Michael S. Tsirkin



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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] vhost-user:How to send memory info
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Linhaifeng @ 2014-12-12  4:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: liuyongan, lilijun,
	n.nikolaev@virtualopensystems.com >> Nikolay Nikolaev,
	Michael S. Tsirkin


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-12  4:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Qemu-devel] vhost-user:How " Linhaifeng

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).