[dpdk-dev] Please help me to debug memory mis-unmap in ovs-dpdk.

Sam batmanustc at gmail.com
Thu Nov 2 04:41:56 CET 2017


Hi all,

I'm debugging a mis-unmap bug in ovs-dpdk, process is this:

1. start ovs-dpdk with 10G socket memory, then use `top`, ovs-vswitchd take
10G memory. command is bellow.
2. start qemu vm1 with vhost device as server to connect port on ovs-dpdk,
command is bellow. qemu share 40G memory with ovs-dpdk, then use `top`,
ovs-vswitchd take 50G memory.
3. start qemu vm2 with vhost device as server to connect port on ovs-dpdk,
command is bellow. qemu share 20G memory with ovs-dpdk, then use `top`,
ovs-vswitchd take 70G memory.
4. stop vm1, then use `top`, ovs-vswitchd take 50G memory (I think it
should be 30G?). use `cat /proc/meminfo`, 70G memory is not released.

Please tell me where is the code ovs-dpdk and qemu communicate with each
other about the map/unmap memory region. Thank you~

Is it old bug? Refer this link:
http://dev.dpdk.narkive.com/m04py1jJ/dpdk-dev-vhost-user-technical-isssues


Command to start ovs-dpdk:
ovs-vswitchd --dpdk -c 0x14 -n 4 --socket-mem 10240 --proc-type secondary
-w 0000:01:00.0 -w 0000:01:00.1 --
unix:/usr/local/var/run/openvswitch/db.sock --pidfile --detach --log-file
--mlockall --no-chdir
--log-file=/usr/local/var/log/openvswitch/ovs-vswitchd.log
--pidfile=/usr/local/var/run/openvswitch/ovs-vswitchd.pid --detach --monitor

Command to start qemu:
/usr/local/bin/qemu-system-x86_64 -enable-kvm -cpu
qemu64,+vmx,+ssse3,+sse4.1,+sse4.2,+x2apic,+aes,+avx,+vme,+pat,+ss,+pclmulqdq,+xsave,level=13
-machine pc,accel=kvm -chardev
socket,id=hmqmondev,port=55919,host=127.0.0.1,nodelay,server,nowait -mon
chardev=hmqmondev,id=hmqmon,mode=readline -rtc
base=utc,clock=host,driftfix=none -usb -device usb-tablet -daemonize
-nodefaults -nodefconfig -no-kvm-pit-reinjection -global
kvm-pit.lost_tick_policy=discard -vga std -k en-us -smp 1 -name
gangyewei-qemutime-07-1 -m 20480 -boot order=cdn -vnc :19,password -drive
file=/opt/cloud/workspace/disks/4a5148da-e34e-4c81-aada-12a247c0337e,if=none,id=drive_0,format=qcow2,cache=none,aio=native
-device virtio-blk-pci,id=dev_drive_0,drive=drive_0,bus=pci.0,addr=0x5
-drive
file=/opt/cloud/workspace/disks/08eb3f72-07ba-44e9-8ee9-4ab662dbbd1f,if=none,id=drive_1,format=qcow2,cache=none,aio=native
-device virtio-blk-pci,id=dev_drive_1,drive=drive_1,bus=pci.0,addr=0x6
-device ide-cd,drive=ide0-cd0,bus=ide.1,unit=1 -drive
id=ide0-cd0,media=cdrom,if=none -chardev
socket,id=char-n-f879ac2f,path=/usr/local/var/run/openvswitch/n-f879ac2f,server
-netdev type=vhost-user,id=n-f879ac2f,chardev=char-n-f879ac2f,vhostforce=on
-device
virtio-net-pci,netdev=n-f879ac2f,mac=00:22:f8:79:ac:2f,id=netdev-n-f879ac2f,addr=0xf,speed=1000
-object
memory-backend-file,id=mem,size=20480M,mem-path=/dev/hugepages,share=on
-mem-prealloc -numa node,memdev=mem -pidfile
/opt/cloud/workspace/servers/63ef2ec4-556f-47ea-93e0-23089bb59be5/pid
-chardev
socket,path=/opt/cloud/workspace/servers/63ef2ec4-556f-47ea-93e0-23089bb59be5/qga.sock,server,nowait,id=qga0
-device virtio-serial -device
virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 -qmp
unix:/opt/cloud/workspace/servers/63ef2ec4-556f-47ea-93e0-23089bb59be5/qmp.sock,server,nowait

Process:
[gangyewei at yf-mos-test-net07 63ef2ec4-556f-47ea-93e0-23089bb59be5]$ top
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
38470 root      10 -10 79.751g 223160  10636 S 200.0  0.2  58:26.77
ovs-vswitchd
 4575 root      20   0 41.338g  90036   2924 S   0.0  0.1   0:21.71
qemu-system-x86
 5914 root      20   0 20.652g  66824   2876 S   0.0  0.1   0:11.90
qemu-system-x86

[gangyewei at yf-mos-test-net07 63ef2ec4-556f-47ea-93e0-23089bb59be5]$ cd
../46c035e2-605c-4997-b4df-15d13f97758f
[gangyewei at yf-mos-test-net07 46c035e2-605c-4997-b4df-15d13f97758f]$ sudo sh
stopvm
Remove PID
/opt/cloud/workspace/servers/46c035e2-605c-4997-b4df-15d13f97758f/pid
Remove VNC
/opt/cloud/workspace/servers/46c035e2-605c-4997-b4df-15d13f97758f/vnc
[gangyewei at yf-mos-test-net07 46c035e2-605c-4997-b4df-15d13f97758f]$ top
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
38470 root      10 -10 55.751g 223160  10636 S 200.3  0.2  59:30.31
ovs-vswitchd
 5914 root      20   0 20.652g  66824   2876 S   0.0  0.1   0:11.92
qemu-system-x86

[gangyewei at yf-mos-test-net07 46c035e2-605c-4997-b4df-15d13f97758f]$ cat
/proc/meminfo
HugePages_Total:     112
HugePages_Free:       42


More information about the dev mailing list