Bug 6583

Summary: [PATCH] parse /proc/bus/pci/devices *once*
Product: xorg Reporter: Bill Nottingham <notting>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: erik.andren, michael.arnauts
Version: gitKeywords: patch
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
patch for PCI code none

Description Bill Nottingham 2006-04-13 12:40:13 UTC
Against 1.0.99.901.

stracing Xorg on startup showed that it opens /proc/bus/pci/devices
approximately 220 times. This seemed inefficient. Hence, patch.

The attached causes it to just parse it once, and then use that data when it's
asked for.

Also includes a small bit to pull config space from
/sys/bus/pci/devices/XXXX:YY:ZZ.A, which can be separated out (might
need work with domains, but it looked like the previous code wasn't getting that
right either.)

The combined effect of this is to shave about half a second off of X server
startup on my laptop (from 5.2 to 4.7 seconds.)
Comment 1 Bill Nottingham 2006-04-13 12:41:02 UTC
Created attachment 5288 [details] [review]
patch for PCI code
Comment 2 Erik Andren 2006-04-18 05:01:27 UTC
Adding patch keyword
Comment 3 Daniel Stone 2006-06-01 15:30:55 UTC
committed to HEAD

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.