Bug 692182 - sysconf(_SC_*CACHE) returns 0 for all caches on some CPUs.
Summary: sysconf(_SC_*CACHE) returns 0 for all caches on some CPUs.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: glibc
Version: 5.6
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Jeff Law
QA Contact: Jeff Law
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-30 16:06 UTC by john.haxby@oracle.com
Modified: 2016-11-24 16:15 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The glibc sysconf() function provides a way for the application to determine values for system limits or options at runtime. The mechanism that sysconf(3) uses to get the various CACHE parameters was incorrectly returning all zeroes on the Xeon X5670. sysconf() was modified to handle this CPU type correctly and return the information requested.
Clone Of:
Environment:
Last Closed: 2013-01-08 03:45:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Variation of the patch posted upstream to use cpuid 4 rather than cpuid 2 when possible (4.08 KB, patch)
2011-03-30 16:06 UTC, john.haxby@oracle.com
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 692177 0 unspecified CLOSED sysconf(_SC_*CACHE) returns 0 for all caches on some CPUs. 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2013:0022 0 normal SHIPPED_LIVE glibc bug fix and enhancement update 2013-01-08 08:38:20 UTC
Sourceware 12587 0 None None None Never

Internal Links: 692177

Description john.haxby@oracle.com 2011-03-30 16:06:07 UTC
Created attachment 488814 [details]
Variation of the patch posted upstream to use cpuid 4 rather than cpuid 2 when possible

Description of problem:
  The mechanism that sysconf(3) uses to get the various CACHE parameters
  fails on the Xen 5670

Version-Release number of selected component (if applicable): 2.12-1.7.el6_0.4

How reproducible:
  Every time

Steps to Reproduce:
1.  Find a machine whose /proc/cpuinfo starts something like this:

  vendor_id       : GenuineIntel
  cpu family      : 6
  model           : 44
  model name      : Intel(R) Xeon(R) CPU           X5670  @ 2.93GHz
  stepping        : 2

2. run "getconf -a | grep CACHE"
3. Observe values printed

Actual results:
  All the cache parameter values are zero.

Expected results:
  Non-zero values for all but the level 4 cache

Additional info:
  Recent CPUs no longer have useful cpuid leaf 2 cache descriptors.  For this
  particular machine, cpuid 2 returns 0x55035a01 0xf0b2ff 0x0 0xca0000 in eax,
  ebx, ecx and edx respectively.  The 0xff in the least significant byte of
  ebx indicates that you need to use cpuid leaf 4.  Actually, for all but
  somewhat old CPUs you're better off using cpuid leaf 4 anyway (the only
  machines I have access to that have a cpuid level less than four are a
  "Intel(R) Pentium(R) 4 CPU 1.70GHz" and "Intel(R) Pentium(R) 4 CPU 2.40GHz"
  both of which are long past their use-by date).

Comment 1 john.haxby@oracle.com 2011-03-30 16:08:53 UTC
Sorry, of course the glibc version should be 2.5-58

Comment 6 RHEL Program Management 2012-04-02 13:10:10 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 7 Jeff Law 2012-04-02 19:01:08 UTC
Note for QE, this was fixed for RHEL 6 (692177).  There is a testcase, but it's not attached to be BZ.  The testcase ID is 87285.

Comment 10 Patsy Griffin 2012-06-18 15:54:51 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The glibc sysconf() function provides a way for the application to determine values for system limits or options at runtime.
The mechanism that sysconf(3) uses to get the various CACHE parameters was incorrectly returning all zeroes on the Xeon X5670. sysconf() was modified to handle this CPU type correctly and return the information requested.

Comment 12 errata-xmlrpc 2013-01-08 03:45:10 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/RHBA-2013-0022.html


Note You need to log in before you can comment on or make changes to this bug.