Bug 952422

Summary: sysconf(_SC_NPROCESSORS_ONLN) performance problem
Product: Red Hat Enterprise Linux 6 Reporter: Jacob Hunt <jhunt>
Component: glibcAssignee: Siddhesh Poyarekar <spoyarek>
Status: CLOSED ERRATA QA Contact: Arjun Shankar <ashankar>
Severity: high Docs Contact:
Priority: high    
Version: 6.5CC: ashankar, bhubbard, fweimer, mfranc, mnewsome, pfrankli, spoyarek
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
This update improves performance of repeated calls of the sysconf function for getting values of _SC_NPROCESSORS_ONLN by caching the value for approximately a second. This could improve performance of some applications that use QReadWriteLocks in the Qt library or any other functionality that involves repeatedly getting the value for _SC_NPROCESSORS_ONLN.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-21 10:45:08 UTC Type: Bug
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
Candidate fix none

Description Jacob Hunt 2013-04-15 23:19:45 UTC
Description of problem:

We have an application that has a lot of threads and uses QReadWriteLocks to protect data that the threads are accessing. When our server is heavily loaded, the application spends about 60% of it's time in system time as opposed to user time. Further investigation showed that the QMutex class is calling sysconf(_SC_NPROCESSORS_ONLN) for each thread that tries to get a lock where that lock is already locked. Thus most of that system time is spent in this system call.

Version-Release number of selected component (if applicable):
glibc-2.12-1.107.el6.x86_64


Additional info:
This has been discussed upstream: 
http://sourceware.org/ml/libc-alpha/2011-06/msg00064.html

Comment 11 Siddhesh Poyarekar 2013-05-29 06:01:42 UTC
Created attachment 754181 [details]
Candidate fix

Comment 14 errata-xmlrpc 2013-11-21 10:45:08 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.

http://rhn.redhat.com/errata/RHSA-2013-1605.html