Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Cause:
Device assignment code failed to release memory used for storing device PCI option ROM contents.
Consequence:
Hot-unplugging assigned devices with an option ROM from a VM did not free the associated ROM memory. Repeatedly adding and removing such devices results in the qemu process size growing.
Fix:
Fix management of memory used for PCI option ROM of assigned devices.
Result:
Removal of assigned devices removes all resources consumed by that device in the qemu process.
DescriptionAlex Williamson
2011-01-04 18:57:22 UTC
Description of problem:
When a PCI device with an option ROM is repeatedly added and removed from a guest, the option ROM memory is leaked, causing the guest processes size to grow and eventually be OOM killed.
Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.128.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Launch guest via libvirt
2. Create xml file to assign device, ex:
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</hostdev>
In this case the device is an 82576 PF device w/ 4MB option ROM (leaks even though ROM is invalid).
3. Loop adding and removing the device:
i=1; while virsh attach-device <guest> <xml>; do echo $i; i=$[i+1]; sleep 1; virsh detach-device <guest> <xml>; sleep 1; done
Actual results:
top in the host shows the guest process size increasing on each iteration
Expected results:
stable guest process size
Additional info:
Fixed by backporting the following patches:
4b785d9624c1127b358d71933bb5ec476a39db25
576af1b5f5524ca0d6587ae43e395313c14059bb
plus additional patch to chmod the rom file
Reproduced on qemu-kvm-0.12.1.2-2.129.el6.
step
1.boot guest.
2.run script
while true; do ps --format 'vsz' `pidof qemu-kvm`; sleep 10; done
3.repeat hotplug and hotunplug PF and observe qemu-kvm process VSZ
Results
shows the guest process size increasing
while true; do ps --format 'vsz' `pidof qemu-kvm`; sleep 10; done
VSZ
2521376
VSZ
2521376
VSZ
2525476 after hotplug
VSZ
2525476
VSZ
2525472 after hotunplug
VSZ
2525472
VSZ
Verified on qemu-kvm-0.12.1.2-2.144.el6 using the same steps.
Results
stable guest process size
while true; do ps --format 'vsz' `pidof qemu-kvm`; sleep 10; done
VSZ
2522228
VSZ
2522228
VSZ
2522232 after hotpulg
VSZ
2522232
VSZ
2522228 after hotunplug
VSZ
2522228
VSZ
2522232 after hotplug
VSZ
2522232
VSZ
2522228 after hotunplug
VSZ
2522228
This issue has been fixed.
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
Cause:
Device assignment code failed to release memory used for storing device PCI option ROM contents.
Consequence:
Hot-unplugging assigned devices with an option ROM from a VM did not free the associated ROM memory. Repeatedly adding and removing such devices results in the qemu process size growing.
Fix:
Fix management of memory used for PCI option ROM of assigned devices.
Result:
Removal of assigned devices removes all resources consumed by that device in the qemu process.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.
http://rhn.redhat.com/errata/RHSA-2011-0534.html
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.
http://rhn.redhat.com/errata/RHSA-2011-0534.html
Description of problem: When a PCI device with an option ROM is repeatedly added and removed from a guest, the option ROM memory is leaked, causing the guest processes size to grow and eventually be OOM killed. Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.128.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. Launch guest via libvirt 2. Create xml file to assign device, ex: <hostdev mode='subsystem' type='pci' managed='yes'> <source> <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </source> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </hostdev> In this case the device is an 82576 PF device w/ 4MB option ROM (leaks even though ROM is invalid). 3. Loop adding and removing the device: i=1; while virsh attach-device <guest> <xml>; do echo $i; i=$[i+1]; sleep 1; virsh detach-device <guest> <xml>; sleep 1; done Actual results: top in the host shows the guest process size increasing on each iteration Expected results: stable guest process size Additional info: Fixed by backporting the following patches: 4b785d9624c1127b358d71933bb5ec476a39db25 576af1b5f5524ca0d6587ae43e395313c14059bb plus additional patch to chmod the rom file