libvirt/tests/qemumemlockdata
Michal Privoznik 5670c50ffb qemu_domain: Increase memlock limit for NVMe disks
When starting QEMU, or when hotplugging a PCI device QEMU might
lock some memory. How much? Well, that's an undecidable problem.

But despite that, we try to guess. And it more or less works,
until there's a counter example. This time, it's a guest with
both <hostdev/> and an NVMe <disk/>. I've started a simple guest
with 4GiB of memory:

  # virsh dominfo fedora
  Max memory:     4194304 KiB
  Used memory:    4194304 KiB

And here are the amounts of memory that QEMU tried to lock,
obtained via:

  grep VmLck /proc/$(pgrep qemu-kvm)/status

  1) with just one <hostdev/>
     VmLck:   4194308 kB

  2) with just one NVMe <disk/>
     VmLck:   4328544 kB

  3) with one <hostdev/> and one NVMe <disk/>
     VmLck:   8522852 kB

Now, what's surprising is case 2) where the locked memory exceeds
the VM memory. It almost resembles VDPA. Therefore, treat is as
such.

Unfortunately, I don't have a box with two or more spare NVMe-s
so I can't tell for sure. But setting limit too tight means QEMU
refuses to start.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2014030
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2023-04-20 08:37:22 +02:00
..
qemumemlock-pc-hardlimit.xml tests: Introduce QEMU memory locking limit tests 2017-03-28 10:54:50 +02:00
qemumemlock-pc-hardlimit+hostdev.xml tests: Update qemumemlock data 2017-07-15 14:50:42 +02:00
qemumemlock-pc-hardlimit+locked.xml tests: Introduce QEMU memory locking limit tests 2017-03-28 10:54:50 +02:00
qemumemlock-pc-hardlimit+locked+hostdev.xml tests: Update qemumemlock data 2017-07-15 14:50:42 +02:00
qemumemlock-pc-hostdev-nvme.xml qemu_domain: Increase memlock limit for NVMe disks 2023-04-20 08:37:22 +02:00
qemumemlock-pc-hostdev.xml tests: Update qemumemlock data 2017-07-15 14:50:42 +02:00
qemumemlock-pc-kvm.xml tests: Introduce QEMU memory locking limit tests 2017-03-28 10:54:50 +02:00
qemumemlock-pc-locked.xml
qemumemlock-pc-locked+hostdev.xml tests: Update qemumemlock data 2017-07-15 14:50:42 +02:00
qemumemlock-pc-tcg.xml tests: Introduce QEMU memory locking limit tests 2017-03-28 10:54:50 +02:00
qemumemlock-pseries-hardlimit.xml tests: Introduce QEMU memory locking limit tests 2017-03-28 10:54:50 +02:00
qemumemlock-pseries-hardlimit+hostdev.xml
qemumemlock-pseries-hardlimit+locked.xml
qemumemlock-pseries-hardlimit+locked+hostdev.xml tests: Update qemumemlock data 2017-07-15 14:50:42 +02:00
qemumemlock-pseries-hostdev.xml
qemumemlock-pseries-kvm.xml
qemumemlock-pseries-locked.xml
qemumemlock-pseries-locked+hostdev.xml tests: Update qemumemlock data 2017-07-15 14:50:42 +02:00
qemumemlock-pseries-tcg.xml