Bug 1491434
Summary: | KVM leaks file descriptors when attaching and detaching virtio-scsi block devices | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | bugzilla |
Component: | qemu-kvm | Assignee: | Fam Zheng <famz> |
Status: | CLOSED ERRATA | QA Contact: | Xueqiang Wei <xuwei> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 7.3 | CC: | aliang, chayang, coli, drjones, famz, juzhang, knoel, lmiksik, michen, mrezanin, pbonzini, qzhang, rbalakri, virt-maint, xuwei, yhong |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | qemu-kvm-1.5.3-149.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-10 14:35:07 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
bugzilla
2017-09-13 19:44:33 UTC
We have not tested to see if this affects non-virtio disks. Presumably, any AIO-backed disk source causes this leak. This is our XML for the domain: <domain type='kvm' id='32'> <name>vm1</name> <uuid>f5e388b4-7abb-4e7f-a949-fbbe4887d92a</uuid> <memory unit='KiB'>1048576</memory> <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>2</vcpu> <resource> <partition>/machine</partition> </resource> <os> <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type> <boot dev='hd'/> </os> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='block' device='disk'> <driver name='qemu' type='raw' cache='none' io='native' discard='unmap'/> <source dev='/dev/loop0'/> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <disk type='block' device='disk'> <driver name='qemu' type='raw' cache='none' io='native' discard='unmap'/> <source dev='/dev/loop1'/> <backingStore/> <target dev='sde' bus='scsi'/> <serial>drive-scsi0-0-0-4</serial> <encryption format='luks'> </encryption> <alias name='scsi0-0-0-4'/> <address type='drive' controller='0' bus='0' target='0' unit='4'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <backingStore/> <target dev='hda' bus='ide'/> <readonly/> <alias name='ide0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </controller> <controller type='ide' index='0'> <alias name='ide'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <controller type='usb' index='0'> <alias name='usb'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <controller type='pci' index='0' model='pci-root'> <alias name='pci.0'/> </controller> <interface type='bridge'> <mac address='52:54:00:17:c7:f4'/> <source bridge='vlanbr23'/> <target dev='vnet19'/> <model type='virtio'/> <driver name='vhost' queues='4'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='pty'> <source path='/dev/pts/3'/> <target type='isa-serial' port='0'/> <alias name='serial0'/> </serial> <console type='pty' tty='/dev/pts/3'> <source path='/dev/pts/3'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> <input type='mouse' bus='ps2'> <alias name='input0'/> </input> <input type='keyboard' bus='ps2'> <alias name='input1'/> </input> <graphics type='vnc' port='5901' autoport='yes' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> <video> <model type='cirrus' vram='16384' heads='1' primary='yes'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='none'> <alias name='balloon0'/> </memballoon> </devices> <seclabel type='dynamic' model='selinux' relabel='yes'> <label>system_u:system_r:svirt_t:s0:c47,c608</label> <imagelabel>system_u:object_r:svirt_image_t:s0:c47,c608</imagelabel> </seclabel> <seclabel type='dynamic' model='dac' relabel='yes'> <label>+107:+107</label> <imagelabel>+107:+107</imagelabel> </seclabel> </domain> Run on latest qemu-kvm-rhev, not hit this issue. The details as below: Host kernel: 3.10.0-693.el7.x86_64 Guest kernel: 3.10.0-648.el7.x86_64 qemu-kvm-rhev-2.9.0-16.el7_4.6 Run once: # virsh attach-device vm1 disk.xml && lsof -p 11147 |grep '\[aio\]' |wc -l && virsh detach-disk vm1 sdzz && lsof -p 11147 |grep '\[aio\]' |wc -l The output: Device attached successfully 1 Disk detached successfully 1 Run it 1000 times, the file descriptors is not increase: shell cmd line: #!/bin/bash let i=0 while [ $i -lt 1000 ] do virsh attach-device vm1 disk.xml && lsof -p 11147 |grep '\[aio\]' |wc -l && virsh detach-disk vm1 sdzz && lsof -p 11147 |grep '\[aio\]' |wc -l let i=$i+1 done The output: Device attached successfully 1 Disk detached successfully 1 Device attached successfully 1 Disk detached successfully 1 ...... Run on latest qemu-kvm, hit this issue. The details as below: Host kernel: 3.10.0-693.el7.x86_64 Guest kernel: 3.10.0-648.el7.x86_64 qemu-kvm-1.5.3-126.el7_3.11 Run once: # virsh attach-device vm1 disk.xml && lsof -p 32235 |grep '\[aio\]' |wc -l && virsh detach-disk vm1 sdzz && lsof -p 32235 |grep '\[aio\]' |wc -l The output: Device attached successfully 3 Disk detached successfully 3 Run it 1000 times, the file descriptors creeping skyward: shell cmd line: #!/bin/bash let i=0 while [ $i -lt 1000 ] do virsh attach-device vm1 disk.xml && lsof -p 32235 |grep '\[aio\]' |wc -l && virsh detach-disk vm1 sdzz && lsof -p 32235 |grep '\[aio\]' |wc -l let i=$i+1 done The output: Device attached successfully 3 Disk detached successfully 3 Device attached successfully 4 Disk detached successfully 4 Device attached successfully 5 Disk detached successfully 5 ...... ...... Device attached successfully 1005 Disk detached successfully 1005 Thanks for taking the time to enter a bug report with us. We use reports like yours to keep improving the quality of our products and releases. That said, we're not able to guarantee the timeliness or suitability of a resolution for issues entered here because this is not a mechanism for requesting support. If this issue is critical or in any way time sensitive, please raise a ticket through your regular Red Hat support channels to make certain it receives the proper attention and prioritization that will result in a timely resolution. For information on how to contact the Red Hat production support team, please visit: https://www.redhat.com/support/process/production/#howto Identified two fixes from upstream that could fix this. Fix included in qemu-kvm-1.5.3-149.el7 Run on qemu-kvm-1.5.3-149.el7, not hit this issue. The details as below: Host kernel: 3.10.0-796.el7.x86_64 Guest kernel: 3.10.0-798.el7.x86_64 qemu-kvm-1.5.3-149.el7 Run once: # virsh attach-device vm1 disk.xml && lsof -p 13626 |grep '\[aio\]' |wc -l && virsh detach-disk vm1 sdzz && lsof -p 13626 |grep '\[aio\]' |wc -l The output: Device attached successfully 3 Disk detached successfully 2 Run it 1000 times, the file descriptors is not increase: shell cmd line: #!/bin/bash let i=0 while [ $i -lt 1000 ] do virsh attach-device vm1 disk.xml && lsof -p 13626 |grep '\[aio\]' |wc -l && virsh detach-disk vm1 sdzz && lsof -p 13626 |grep '\[aio\]' |wc -l let i=$i+1 done The output: Device attached successfully 3 Disk detached successfully 2 Device attached successfully 3 Disk detached successfully 2 Device attached successfully 3 Disk detached successfully 2 ...... ...... Device attached successfully 3 Disk detached successfully 2 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:0816 |