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

libvirt report unexpected warning about shared memory in the log

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.6, rhel-10.0
    • libvirt
    • No
    • Low
    • rhel-sst-virt-tools
    • ssg_virtualization
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      What were you trying to do that didn't work?

      libvirt report unexpected warning about shared memory in the log

      What is the impact of this issue to you?

      The warning is not accurate which can be misleading

      Please provide the package NVR for which the bug is seen:

      libvirt-10.10.0-7.el10.x86_64

      How reproducible is this bug?:

      100%

      Steps to reproduce

      1. There can be sevaral methods to configure shared memory, try them all with vhostuser interface and check the libvirtd log.
      vhostuser type interface xml:

      <interface type="vhostuser">
        <backend type="passt"/>
      </interface>
      

      1) with hugepages, but without numa node setting:

       <memory unit='KiB'>2097152</memory>
        <currentMemory unit='KiB'>2097152</currentMemory>
        <memoryBacking>
          <hugepages>
            <page size='2048' unit='KiB'/>
          </hugepages>
          <access mode='shared'/>
        </memoryBacking>
       <cpu mode='host-model' check='partial'/>
      

      Start vm, there will be warning in libvirtd log:

      2025-02-24 15:56:51.946+0000: 83979: warning : qemuProcessStartWarnShmem:5453 : Detected vhost-user interface without any shared memory, the interface might not be operational
      

      2) Use memfd memory

       <memoryBacking>
          <source type='memfd'/>
          <access mode='shared'/>
        </memoryBacking>
      

      Start the vm, will get the warning as well

      3) Use File-backed memory + /dev/shm
      Add below setting in qemu.conf, then restart virtqemud

      memory_backing_dir = "/dev/shm/"

      add memoryBacking into xml, then start the vm

       <memoryBacking>
          <access mode='shared'/>
        </memoryBacking>
      

      It will get the same warning.

      4) Use file-backed memory without setting "/dev/shm/" thing

       <memoryBacking>
          <access mode='shared'/>
        </memoryBacking>
      

      Start vm will also get the warning

      Expected results

      If these are correct shared-memory setting, libvirt should not report warning in the log

      Actual results

      Only when we use hugepages and set numa node on the vm, and set  "memAccess='shared'" on the numa node, the warning will not show.

      <memoryBacking>
          <hugepages>
            <page size='2048' unit='KiB'/>
          </hugepages>
          <access mode='shared'/>
        </memoryBacking>
       <cpu mode='host-model' check='partial'>
          <numa>
            <cell id='0' cpus='0-3' memory='2097152' unit='KiB' memAccess='shared'/>
          </numa>
        </cpu>
      

              pkrempa@redhat.com Peter Krempa
              yalzhang@redhat.com Yalan Zhang
              Peter Krempa Peter Krempa
              Yalan Zhang Yalan Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: