libvirt | kvm: fix a bug with Android-x86 virtual machines where the VM becomes unresponsive and unkillable if its process is swapped to disk
Host: Arch Linux with kernel 4.16.3; qemu 2.11.1; libvirt 4.2.0;
AMD FX-6350; 8GiB RAM; with 8GiB swap file
Guest: (custom build) Android-x86 7.1-rc1; kernel 4.9.31
QEMU/KVM x86_64; UEFI (ovmf 1:r23518.6d2d2e6e5b-1); chipset Q35; disk bus VIRTIO; disk format QCOW2; cache mode: none
Description: VM is running and the host begins to run out of RAM. Once memory from the qemu instance is swapped to disk, the VM becomes 100% unresponsive and never recovers, even after:
RAM is released by other applications and made available
swapped memory is forced back to RAM with
sudo swapoff -a
Failed to terminate process X with SIGKILL: Device or resource busy
Nothing ever works: host shutdown (hangs); host reboot (hangs; even with
-f); force reboot by pressing Ctrl + Alt + Del 7 times within 2 seconds.
A hard reset is needed.