Public bug reported: == Comment: #0 - SRIKANTH AITHAL <bssrika...@in.ibm.com> - 2019-03-12 03:13:37 == ---Problem Description--- Even when host have enough cmafree, p8compat guest fails to start. In my case I see on host we have ~3GB of cmafree.. but guest [which had 4GB RAM with hpt-resize=required] failed to boot complaining `cma: cma_alloc: alloc failed, req-size: 512 pages, ret: -16` which is 32MB of cma space.
---Steps to Reproduce--- Host has 1 TB of RAM. I have 28 guests running on it [14 of them are p8compat rhel 7.6 guests]. There is a additional p8compat guest with 4GB RAM and hpt-resize=required just to do save/restore in parallel to 28 guests which were running stress in them. After 33 times of successful save/restore, 34th attempt on wards I see below error while restoring: ```Failed to restore domain from /home/srikanth/rhelcompat_test.file error: internal error: qemu unexpectedly closed the monitor: 2019-03-12T06:51:08.170016Z qemu-system-ppc64: Failed to allocate KVM HPT of order 25 (try smaller maxmem?): Cannot allocate memory ``` below was cmastat at that point of time: CmaTotal: 53690368 kB CmaFree: 3425920 kB In the dmesg I could see the error message: `cma: cma_alloc: alloc failed, req-size: 512 pages, ret: -16` Qemu log of that p8compat[rhelcompat_test] guest had below error: /usr/bin/qemu-system-ppc64 -name guest=rhelcompat_test,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-18167-rhelcompat_test/master-key.aes -machine pseries-2.11,accel=kvm,usb=off,dump-guest-core=off,resize-hpt=required -m 4096 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 4409e0d3-5309-4d4a-bae8-7e2bc42547c8 -display none -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-18167-rhelcompat_test/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot strict=on -device qemu-xhci,id=usb,bus=pci.0,addr=0x3 -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x2 -drive file=/home/srikanth/rhel76-ppc64le_test.qcow2,format=qcow2,if=none,id=drive-scsi0-0-0-0 -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 -netdev tap,fd=50,id=hostnet0,vhost=on,vhostfd=55 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:3c:a2:1d,bus=pci.0,addr=0x1 -chardev pty,id=charserial0 -device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 -incoming defer -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 -msg timestamp=on 2019-03-12 06:56:56.427+0000: 115293: info : virObjectUnref:350 : OBJECT_UNREF: obj=0x7182a4115280 2019-03-12T06:56:56.846023Z qemu-system-ppc64: -chardev pty,id=charserial0: char device redirected to /dev/pts/22 (label charserial0) 2019-03-12T06:57:05.009047Z qemu-system-ppc64: Failed to allocate KVM HPT of order 25 (try smaller maxmem?): Cannot allocate memory 2019-03-12T06:57:05.009092Z qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr/htab' 2019-03-12T06:57:05.009690Z qemu-system-ppc64: load of migration failed: Invalid argument 2019-03-12 06:57:05.203+0000: shutting down, reason=failed Expected result: ========== Restore of that p8compat mode guest should have worked since we had enough cmafree space available. Contact Information = srikanth/bssrika...@in.ibm.com Machine Type = witherspoon ---uname output--- Linux pok1-qz1-sr1-rk005-s06 4.15.0-1016.18-fix1-ibm-gt #fix1 SMP Wed Feb 20 15:48:47 CST 2019 ppc64le ppc64le ppc64le GNU/Linux ---Debugger--- A debugger is not configured Stack trace output: no System Dump Info: The system was configured to capture a dump, however a dump was not produced. Oops output: no *Additional Instructions for srikanth/bssrika...@in.ibm.com: -Attach sysctl -a output output to the bug. == Comment: #1 - SRIKANTH AITHAL <bssrika...@in.ibm.com> - 2019-03-12 03:20:54 == == Comment: #2 - SRIKANTH AITHAL <bssrika...@in.ibm.com> - 2019-03-12 03:21:26 == == Comment: #3 - SRIKANTH AITHAL <bssrika...@in.ibm.com> - 2019-03-12 03:21:45 == == Comment: #4 - SRIKANTH AITHAL <bssrika...@in.ibm.com> - 2019-03-12 03:22:08 == == Comment: #5 - SRIKANTH AITHAL <bssrika...@in.ibm.com> - 2019-03-12 03:24:55 == snippet from save_restore console log where the issue was noticed: Save Restore of rhelcompat_test iteration number: 34 Domain rhelcompat_test saved to /home/srikanth/rhelcompat_test.file Cma stats after save cma: CmaTotal: 53690368 kB CmaFree: 3425920 kB restore fails: error: Failed to restore domain from /home/srikanth/rhelcompat_test.file error: internal error: qemu unexpectedly closed the monitor: 2019-03-12T06:51:08.170016Z qemu-system-ppc64: Failed to allocate KVM HPT of order 25 (try smaller maxmem?): Cannot allocate memory 2019-03-12T06:51:08.170064Z qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr/htab' 2019-03-12T06:51:08.170680Z qemu-system-ppc64: load of migration failed: Invalid argument We can see above that we had ~3GB of cma free space but guest failed to get restored/started. ** Affects: qemu (Ubuntu) Importance: Undecided Assignee: Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) Status: New ** Tags: architecture-ppc64le bugnameltc-176065 severity-high targetmilestone-inin--- ** Tags added: architecture-ppc64le bugnameltc-176065 severity-high targetmilestone-inin--- -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1820257 Title: Failed to bringup p8compat mode guest even when we had enough cma To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1820257/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs