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

optimize CPU flag probing QMP conversation

    • None
    • None
    • rhel-sst-virtualization
    • ssg_virtualization
    • 8
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      Description of problem:
      Libvirt uses a very inefficient way to probe qemu for CPU feature flags, which is done by using ~400 QMP calls and responses to fetch all the required information as each flag is queried one-by-one. This is due to the lack of a better interface in qemu.

      This takes a significant amount of time during the startup of the VM:

      2022-02-07 11:41:50.811+0000: 1758242: info : qemuMonitorIOWrite:402 : QEMU_MONITOR_IO_WRITE: mon=0x7fff9c1d2a20 buf={"execute":"qom-get","arguments":

      {"path":"/machine/unattached/device[0]","property":"realized"}

      ,"id":"libvirt-8"}
      len=115 ret=115 errno=0

      [...]

      2022-02-07 11:41:50.950+0000: 1758242: info : qemuMonitorIOWrite:402 : QEMU_MONITOR_IO_WRITE: mon=0x7fff9c1d2a20 buf={"execute":"qom-get","arguments":

      {"path":"/machine/unattached/device[0]","property":"unavailable-features"}

      ,"id":"libvirt-395"}
      len=129 ret=129 errno=0

      In my example case it's 0.14s just to probe the features.

      Libvirt should work with qemu to provide a better interface where we can fetch multiple flags at once.

              jdenemar@redhat.com Jiri Denemark
              pkrempa@redhat.com Peter Krempa
              Jiri Denemark Jiri Denemark
              Han Han Han Han
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated: