Bug 57941 - Cpufreq stats are not shown in sysfs
Summary: Cpufreq stats are not shown in sysfs
Status: REJECTED INVALID
Alias: None
Product: Power Management
Classification: Unclassified
Component: cpufreq (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Rafael J. Wysocki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-10 12:07 UTC by Justin
Modified: 2013-06-04 01:09 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.9
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
config.gz (18.60 KB, application/gzip)
2013-05-10 12:07 UTC, Justin
Details
munin cpuspeed plugin (2.76 KB, application/octet-stream)
2013-05-13 14:47 UTC, Justin
Details

Description Justin 2013-05-10 12:07:01 UTC
Created attachment 101061 [details]
config.gz

I am missing /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state after switching from 3.8 to 3.9.

CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
CONFIG_X86_PCC_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ=y
# CONFIG_X86_ACPI_CPUFREQ_CPB is not set
#
# x86 CPU frequency scaling drivers
#
CONFIG_X86_INTEL_PSTATE=y
CONFIG_X86_PCC_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ=y
# CONFIG_X86_ACPI_CPUFREQ_CPB is not set
# CONFIG_X86_POWERNOW_K8 is not set
# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
# CONFIG_X86_P4_CLOCKMOD is not set
Comment 1 Viresh Kumar 2013-05-12 15:18:58 UTC
On Fri, May 10, 2013 at 5:37 PM,  <bugzilla-daemon@bugzilla.kernel.org> wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=57941
>
>            Summary: Cpufreq stats are not shown in sysfs
>            Product: Power Management
>            Version: 2.5
>     Kernel Version: 3.9
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: cpufreq
>         AssignedTo: cpufreq@vger.kernel.org
>         ReportedBy: jlec@gentoo.org
>         Regression: Yes
>
>
> Created an attachment (id=101061)
>  --> (https://bugzilla.kernel.org/attachment.cgi?id=101061)
> config.gz
>
> I am missing /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state after
> switching from 3.8 to 3.9.

Only this one is missing or complete stats directory?
Comment 2 Justin 2013-05-12 16:16:51 UTC
(In reply to comment #1)
> Only this one is missing or complete stats directory?

You are right. The complete directory is missing.

# ll /sys/devices/system/cpu/cpu0/cpufreq/
total 0
-r--r--r-- 1 root root 4.0K May 12 18:16 affected_cpus
-r-------- 1 root root 4.0K May 12 18:16 cpuinfo_cur_freq
-r--r--r-- 1 root root 4.0K May 12 11:26 cpuinfo_max_freq
-r--r--r-- 1 root root 4.0K May 12 11:26 cpuinfo_min_freq
-r--r--r-- 1 root root 4.0K May 12 18:16 cpuinfo_transition_latency
-r--r--r-- 1 root root 4.0K May 12 18:16 related_cpus
-r--r--r-- 1 root root 4.0K May 12 18:16 scaling_available_governors
-r--r--r-- 1 root root 4.0K May 12 18:16 scaling_driver
-rw-r--r-- 1 root root 4.0K May 12 18:16 scaling_governor
-rw-r--r-- 1 root root 4.0K May 12 11:26 scaling_max_freq
-rw-r--r-- 1 root root 4.0K May 12 18:16 scaling_min_freq
-rw-r--r-- 1 root root 4.0K May 12 18:16 scaling_setspeed
Comment 3 Dirk Brandewie 2013-05-13 14:42:26 UTC
If you are running on a Sandybridge based system you will be using the intel_pstate driver.  This scaling driver has an internal governor and does issue the CPUFREQ_{PRE/POST}CHANGE notifications like other governors. 

What are you using time in state for maybe I can help you get the information you need.

--Dirk
Comment 4 Justin 2013-05-13 14:47:49 UTC
Created attachment 101281 [details]
munin cpuspeed plugin

I am using it for munins cpuspeed plugin.
Comment 5 Dirk Brandewie 2013-05-17 16:28:01 UTC
The information returned by cpufreq stats for current intel CPU's is a well documented fiction since the scaling driver only requests a given P state/frequency the actual frequency the package runs at is decided by the CPU itself based on the requests from all cores/threads.  The info that you are getting from cpufreq stats is only what requests were made and not frequency.

intel_pstate reportes the frequency that the core last ran at which is as close as I can get to reality is available from /proc/cpuinfo or from 
/sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq

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