Bug 480687

Summary: Udev helper "rename_device" saturates the system with thousands of devices
Product: [Fedora] Fedora Reporter: Dan Smith <danms>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: jwboyer, notting, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-19 21:57:14 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:
Attachments:
Description Flags
Improve performance with large numbers of interfaces none

Description Dan Smith 2009-01-19 20:24:38 UTC
Created attachment 329396 [details]
Improve performance with large numbers of interfaces

Description of problem:
The rename_device helper inefficiently scans sysfs for information about a given network device, which becomes very slow if the system has a large number of network devices (as would be the case on a system with many virtualized guests).  The attached patch improves the performance by streamlining the process of getting interface information.

Using a test of creating 1500 veth pairs (3000 devices total), the attached patch improves performance by 250% and significantly decreases the load on the system during the test.

Tested on Fedora x86_64.

 rename_device.c |   92 +++++++++++---------------------------------------------
 1 file changed, 19 insertions(+), 73 deletions(-)

Version-Release number of selected component (if applicable): The patch was generated and tested with initscripts-8.86.


How reproducible: Always.


Steps to Reproduce:
1. Write a script to generate 1500 veth devices
2. Measure time to run the script before and after the patch

Comment 1 Bill Nottingham 2009-01-19 21:54:15 UTC
There's an obvious bug/typo in your new asprintf call, but looks good otherwise. Added.

Comment 2 Bill Nottingham 2009-01-19 21:57:14 UTC
http://git.fedorahosted.org/git/?p=initscripts.git;a=commitdiff;h=eb1d89063ed017db9deed6fe7ed9e0beef77eb6b

Will get to rawhide at some point.