Red Hat Bugzilla – Bug 311341
Incorrect CPU topology parsing
Last modified: 2008-05-21 13:21:20 EDT
+++ This bug was initially created as a clone of Bug #301821 +++
Description of problem:
irqbalance uses the topology information from /sys/devices/system/cpu. I
noticed that when reading the hierarchy irqbalance tries to open nonsense files like
This is due to an incomplete check when reading the directory
/sys/devices/system/cpu. The code only checks for a substring "cpu" to be
Once I fixed that I noticed that irqbalance doesn't access these files after the
startup anymore. This is probably due to the fact that recognizing "cpuidle" as
a real CPU the CPU count is thrown off. I haven't investigated this further.
But this little inefficiency is in fact a real bug.
While I was at it I rewrote a large amount of inefficient code. openat() saves
creating path strings and reduces the lookup times. Not creating a new string
for each getline call saves overhead related to memory handling.
Version-Release number of selected component (if applicable):
always (I guess)
Steps to Reproduce:
2.attach to it using strace or use a systemtap script monitoring open calls
Lots of reloading the /sys/devices/system/cpu/ hierarchy and looking for
Infrequent (none after startup?) parsing of the hierarchy. Don't look into
/sys/devices/system/cpu/cpuidle/ at all.
This patch should probably also be added to RHEL5 and F7.
-- Additional comment from firstname.lastname@example.org on 2007-09-22 18:20 EST --
Created an attachment (id=203251)
Patch to avoid unnecessary lookups and small optimizations
-- Additional comment from email@example.com on 2007-09-26 15:58 EST --
Thanks Uli, this all looks good to me. I'll get this to upstream, F7/8 amd RHEL
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release. Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products. This request is not yet committed for inclusion in an Update
fixed in 0.55-7
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 the 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.