Bug 1759904

Summary: virsh command delay issue on DPDK node
Product: Red Hat Enterprise Linux 7 Reporter: Roman Hodain <rhodain>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: Luyao Huang <lhuang>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.8CC: apevec, bdobreli, cchen, cfields, cfontain, chhu, chrisw, dyuan, fbaudin, fhallal, gveitmic, jdenemar, jlibosva, jraju, jsuchane, knoha, ktraynor, lhuang, lmen, maxime.coquelin, mkim, mprivozn, mzheng, rbalakri, rhos-maint, xuzhang, yalzhang
Target Milestone: rcKeywords: GSS-NFV-Escalation, Triaged, Upstream, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-4.5.0-27.el7 Doc Type: Bug Fix
Doc Text:
Cause: When creating a child process (e.g. to run another binary), libvirt closes filedescriptors right after the child process is created and keep only handful of them open. This is to enhance security, because we can't blindly trust that binary will not misuse any of the passed FDs. So far, this so called mass close of FDs was done by iterating throug every possible FD in range of 3 to 'limit of open files' and either called close() or made FD survive exec(). Problem is, only a handful of FDs need to be preserved and also only very few FDs need to be closed. The majority of FDs that we are trying to close() are not open really. While there is no technical problem, every close() is a syscall and as such adds some overhead. This is more visible if the limit for open files is way bigger than the default (1024). It that's the case, spawning a runnig a binary in a child process becomes very expensive (time-wise). Consequence: Fetching stats for an OVS interface is delayed and very annoying. Fix: Closing of FDs was changed. Now libvirt utilizes /proc filesystem to learn all FDs that are open and iterate only through them instead of the full range of possible FDs. Because the proportion between the two, this approach takes way less time and achieves the same result. I mean, like 99% of FDs within the range were never open really and thus are closed already, but we were trying to close() them anyway. Result: Fetching statistics is now as smooth as baby skin.
Story Points: ---
Clone Of: 1721434
: 1760470 (view as bug list) Environment:
Last Closed: 2020-03-31 19:59:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1721434    
Bug Blocks: 1760470    

Comment 5 Luyao Huang 2019-10-14 07:27:02 UTC
Verify this bug on libvirt-4.5.0-27.el7.x86_64 with same steps in bug 1721434 comment 69

Comment 7 errata-xmlrpc 2020-03-31 19:59:02 UTC
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/RHBA-2020:1094