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

The Disk Performance with An IOthread Is Worse Than Without

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.4
    • qemu-kvm / Storage
    • None
    • Major
    • sst_virtualization_storage
    • ssg_virtualization
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • x86_64
    • None

      What were you trying to do that didn't work?
      The disk performance with an IOthread is worse than without any IOthreads.

       

      Please provide the package NVR for which bug is seen:
      Qemu-kvm-8.1.0-3.el9
      Kernel-5.14.0-397.el9.x86_64

      Host env:

      1. lspci | grep NVMe
        cb:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller 172Xa/172Xb (rev 01)
      2. cat /sys/bus/pci/devices/0000\:cb\:00.0/numa_node 
        1
      1. lscpu 
        Architecture:            x86_64
          CPU op-mode(s):        32-bit, 64-bit
          Address sizes:         46 bits physical, 57 bits virtual
          Byte Order:            Little Endian
        CPU(s):                  96
          On-line CPU(s) list:   0-95
        Vendor ID:               GenuineIntel
          BIOS Vendor ID:        Intel
          Model name:            Intel(R) Xeon(R) Gold 6442Y
            BIOS Model name:     Intel(R) Xeon(R) Gold 6442Y
            CPU family:          6
            Model:               143
            Thread(s) per core:  2
            Core(s) per socket:  24
            Socket(s):           2
            Stepping:            8
            CPU max MHz:         4000.0000
            CPU min MHz:         800.0000
            BogoMIPS:            5200.00
            Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm
                                  constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx 
                                 smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowp
                                 refetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 invpcid_single cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fs
                                 gsbase tsc_adjust sgx bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_n
                                 i avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd
                                  dtherm ida arat pln pts hfi vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq
                                  la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd sgx_lc fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_
                                 tile amx_int8 flush_l1d arch_capabilities
        Virtualization features: 
          Virtualization:        VT-x
        Caches (sum of all):     
          L1d:                   2.3 MiB (48 instances)
          L1i:                   1.5 MiB (48 instances)
          L2:                    96 MiB (48 instances)
          L3:                    120 MiB (2 instances)
        NUMA:                    
          NUMA node(s):          2
          NUMA node0 CPU(s):     0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94
          NUMA node1 CPU(s):     1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95
        Vulnerabilities:         
          Gather data sampling:  Not affected
          Itlb multihit:         Not affected
          L1tf:                  Not affected
          Mds:                   Not affected
          Meltdown:              Not affected
          Mmio stale data:       Not affected
          Retbleed:              Not affected
          Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
          Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
          Spectre v2:            Mitigation; Enhanced / Automatic IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
          Srbds:                 Not affected
          Tsx async abort:       Not affected
      1. lsblk 
        NAME                           MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
        sda                              8:0    0 893.8G  0 disk 
        ├─sda1                           8:1    0   600M  0 part /boot/efi
        ├─sda2                           8:2    0     1G  0 part /boot
        └─sda3                           8:3    0 892.2G  0 part 
          ├─rhel_dell-per760-02-root 253:0    0    70G  0 lvm  /
          ├─rhel_dell-per760-02-swap 253:1    0     4G  0 lvm  [SWAP]
          └─rhel_dell-per760-02-home 253:2    0 818.2G  0 lvm  /home
        nvme0n1                        259:0    0 745.2G  0 disk 
      1. free -h
                       total        used        free      shared  buff/cache   available
        Mem:           242Gi       3.0Gi       226Gi        18Mi        15Gi       239Gi
        Swap:          4.0Gi          0B       4.0Gi

       

      How reproducible:
      100%

       

      Steps to reproduce
      Baseline: no iothread
      1.bootup a guest with the nvme host diks as data disk and vcpus are pinned to host cpus
      <domain type="kvm" xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
        <name>rhel</name>
        <uuid>268a093f-b867-4a6c-8fec-1d58aee7e7fa</uuid>
        <memory>2097152</memory>
        <currentMemory>2097152</currentMemory>
        <iothreads>1</iothreads>
        <vcpu placement='static' cpuset="1,3,5,7,9,11,13,15">8</vcpu>
        <cputune>
          <vcpupin vcpu='0' cpuset='1'/>
          <vcpupin vcpu='1' cpuset='3'/>
          <vcpupin vcpu='2' cpuset='5'/>
          <vcpupin vcpu='3' cpuset='7'/>
          <vcpupin vcpu='4' cpuset='9'/>
          <vcpupin vcpu='5' cpuset='11'/>
          <vcpupin vcpu='6' cpuset='13'/>
          <vcpupin vcpu='7' cpuset='15'/>
          <emulatorpin cpuset='17'/>
          <iothreadpin iothread='1' cpuset='19'/>
        </cputune>
        <os firmware="efi">
          <type arch="x86_64" machine="q35">hvm</type>
          <boot dev="hd"/>
        </os>
        <features>
          <acpi/>
          <apic/>
          <kvm>
            <hint-dedicated state='on'/>
            <poll-control state='on'/>
          </kvm>
        </features>
        <cpu mode='host-passthrough' check='partial'>
          <model fallback='allow'/>
        </cpu>
        <clock offset="utc">
          <timer name="rtc" tickpolicy="catchup"/>
          <timer name="pit" tickpolicy="delay"/>
          <timer name="hpet" present="no"/>
        </clock>
        <pm>
          <suspend-to-mem enabled="no"/>
          <suspend-to-disk enabled="no"/>
        </pm>
        <devices>
          <emulator>/usr/libexec/qemu-kvm</emulator>
          <disk type="file" device="disk">
            <driver name="qemu" type="qcow2"/>
            <source file="/home/timao/perf/rhel900-64-virtio-ovmf.qcow2"/>
            <target dev="vda" bus="virtio"/>
          </disk>
          <controller type="usb" model="ich9-ehci1"/>
          <controller type="usb" model="ich9-uhci1">
            <master startport="0"/>
          </controller>
          <controller type="usb" model="ich9-uhci2">
            <master startport="2"/>
          </controller>
          <controller type="usb" model="ich9-uhci3">
            <master startport="4"/>
          </controller>
          <controller type="pci" model="pcie-root"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <controller type="pci" model="pcie-root-port"/>
          <interface type="bridge">
            <source bridge="switch"/>
            <mac address="52:54:00:02:13:36"/>
            <model type="e1000e"/>
          </interface>
          <console type="pty"/>
          <input type="tablet" bus="usb"/>
          <tpm model="tpm-crb">
            <backend type="emulator"/>
          </tpm>
          <graphics type="vnc" port="-1"/>
          <video>
            <model type="bochs"/>
          </video>
        </devices>
        <qemu:commandline>
          <qemu:arg value='-blockdev'/>
          <qemu:arg value='{"driver":"host_device","filename":"/dev/nvme0n1","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}'/>
          <qemu:arg value='-blockdev'/>
          <qemu:arg value='{"node-name":"libvirt-2-format","read-only":false,"driver":"raw","file":"libvirt-2-storage"}'/>
          <qemu:arg value='-device'/>
          <qemu:arg value='{"driver":"virtio-blk-pci","bus":"pci.7","addr":"0x0","drive":"libvirt-2-format","id":"virtio-disk2"}'/>
        </qemu:commandline>
      </domain>

      2. Fio testing in the guest on the nvme data disk
      Test for 5 times:
      #!/bin/bash

      for i in 1 2 3 4 5 
      do
          fio --rw=randrw --bs=4k --iodepth=8 --runtime=30 --ramp_time=5 --direct=1 --filename=/dev/vdb --name=job1 --ioengine=libaio --thread --group_reporting --cpus_allowed=0-7 --cpus_allowed_policy=split --numjobs=8 --time_based --output=/tmp/fio_result_${i}
          sleep 60
          echo "$i time fio is over."
      done

       

      Result:
      Avg(Remove the highest and lowest values, then calculate the average):
      Read: IOPS=129k
      Write: IOPS=129k

      1st time:
      Read: IOPS=87.6k
      Write: IOPS=87.6k

      2nd time:
      Read: IOPS=120k
      Write: IOPS=120k

      3rd time:
      Read: IOPS=137k
      Write: IOPS=137k

      4th time:
      Read: IOPS=130k
      Write: IOPS=130k

      5th time:
      Read: IOPS=146k
      Write: IOPS=146k

       

      With 1 iothread:
      Steps with the disk arg as below, others are the same as baseline:
      .....
      <qemu:arg value='{"driver":"virtio-blk-pci","bus":"pci.7","addr":"0x0","drive":"libvirt-2-format","id":"virtio-disk2","iothread": "iothread1"}'/>
      ….
         

      Result:
      Avg(Remove the highest and lowest values, then calculate the average):
      Read: IOPS=85.4k
      Write: IOPS=85.5k

      1st time:
      Read: IOPS=83.9k
      Write: IOPS=84.0k

      2nd time:
      Read: IOPS=85.6k
      Write: IOPS=85.6k

      3rd time:
      Read: IOPS=86.1k
      Write: IOPS=86.1k

      4th time:
      Read: IOPS=84.7k
      Write: IOPS=84.8k

      5th time:
      Read: IOPS=86.0k
      Write: IOPS=86.1k

       

      Expected results
      The performance with the iothread is better than without

       

      Actual results
      The disk performance with an IOthread is worse than without any IOthreads.
      Read(IOPS):85.4k vs 129k.

            shajnocz@redhat.com Stefan Hajnoczi
            timao@redhat.com Tingting Mao
            virt-maint virt-maint
            qing wang qing wang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: