Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-15316

libvirt: support dynamic virtio-mem device via multiple memslots

    • libvirt-10.0.0-3.el9
    • sst_virtualization
    • ssg_virtualization
    • 26
    • Dev ack
    • False
    • Hide

      None

      Show
      None
    • OpenShift Virtualization
    • x86_64, aarch64

      We want to support dynamically using multiple memslots to expose virtio-mem device memory to the VM; using dynamically multiple memslots can drastically reduce memory overhead in the hypervisor (especially, KVM), when a device exposes only comparatively small memory towards the VM, compared to its possible maximum size.

      For QEMU, the feature is enabled using "dynamic-memslots=on". With "dynamic-memslots=off" (current default), the feature is disabled and we default to using a single large memslot statically.

      In combination with vhost devices, this new feature can be problematic if the devices support less than 509 memslots. If such devices are created before the virtio-mem device in QEMU, virtio-mem will default to the old handling of using a single memslot only. If the devices are created after the virtio-mem devices (on the cmdline, hotplug of such devices), QEMU will bail out.

      For vhost support in the kernel, we should always have 509 memslots configured in RHEL using

      $ cat /etc/modprobe.d/vhost.conf 
      # Increase default vhost memory map limit to match
      # KVM's memory slot limit
      options vhost max_mem_regions=509
      

      vhost-user based on rust-vmm/vhost supports significantly less memslots (16? 32?) and needs support for more memslots.

      Initial support has been merged into QEMU and will be part of QEMU 8.2.0. One bugfix is still pending.

            mprivozn@redhat.com Michal Privoznik
            dhildenb@redhat.com David Hildenbrand
            virt-maint virt-maint
            Liang Cong Liang Cong
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: