RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 741734 - FEAT: /sys should provide more accurate current cpu frequency
Summary: FEAT: /sys should provide more accurate current cpu frequency
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: 6.3
Assignee: Red Hat Kernel Manager
QA Contact: Evan McNabb
URL:
Whiteboard:
Depends On:
Blocks: 767187
TreeView+ depends on / blocked
 
Reported: 2011-09-27 19:19 UTC by Rob Landry
Modified: 2016-07-22 23:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-22 23:05:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Rob Landry 2011-09-27 19:19:26 UTC
Description of problem:

Today the cpufreq values provided in sys/devices/system/cpu/cpuX/ may be inaccurate when compared to a aperfmperf values.  During the development of the updated hwcert cpuscaling for v7-1.4 aperfmperf was deemed to be the authoritative source of what speed is the core is actually running at. 


Steps to Reproduce:
1. compare aperfmperf calculation from aperf code provided by mjg to /sys cpuinfo_cur_freq and scaling_cur_freq values.
  
Actual results:
aperf and /sys show different values.

Expected results:
some /sys entry would show the same value as aperf.

Additional info:
TurboBoost/Core for example are not reflected in the current /sys values but appear in the aperf output.

Comment 3 Rik van Riel 2011-11-04 19:52:32 UTC
The CPU frequency can change several times a second with the in-kernel automatic CPU speed governors.

I would not be surprised to see different readings at different times.

Exactly what kind of discrepancies are you seeing?

Comment 4 Rob Landry 2011-11-14 22:22:06 UTC
Example:

This is on my laptop which is performing work (thunderbird, firefox, etc.) not similar to the test environment we should have on a v7 test box.


[root@unused cpufreq]# pwd
/sys/devices/system/cpu/cpu2/cpufreq
[root@unused cpufreq]# cat cpuinfo_cur_freq 
2701000
[root@unused cpufreq]# cat scaling_cur_freq 
800000
[root@unused cpufreq]# ~rlandry/Downloads/aperf 2
Freq: 3.045GHz
[root@unused cpufreq]# cpufreq-aperf 
CPU	Average freq(KHz)	Time in C0	Time in Cx	C0 percentage
000	2511930			00 sec 003 ms	00 sec 996 ms	00
001	3214190			00 sec 931 ms	00 sec 068 ms	93
002	2971100			00 sec 737 ms	00 sec 262 ms	73
003	2917080			00 sec 153 ms	00 sec 846 ms	15

000	2809040			00 sec 571 ms	00 sec 428 ms	57
001	2538940			00 sec 291 ms	00 sec 708 ms	29
002	1458540			00 sec 200 ms	00 sec 799 ms	20
003	1404520			00 sec 227 ms	00 sec 772 ms	22

^C
[root@unused cpufreq]# cat scaling_governor 
userspace
[root@unused cpufreq]# 


Today v7 uses mgj's aperf command as the authoritative value; though it is not part of the OS.

Comment 5 RHEL Program Management 2012-05-03 05:28:53 UTC
Since RHEL 6.3 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 7 Rik van Riel 2016-07-22 23:05:42 UTC
This feature has now been obsoleted by new hardware.

The latest CPUs scale the frequency all by themselves, autonomously from the operating system. Statistics on how much of each frequency was used get exported through sysfs.


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