]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Thomas Renninger <trenn@suse.de> |
2 | Subject: CPUFREQ: Introduce /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_transition_latency | |
3 | References: bnc#464461 | |
4 | Patch-Mainline: not yet | |
5 | ||
6 | It's not only useful for the ondemand and conservative governors, but | |
7 | also for userspace daemons to know about the HW transition latency of | |
8 | the CPU. | |
9 | It is especially useful for userspace to know about this value when | |
10 | the ondemand or conservative governors are run. The sampling rate | |
11 | control value depends on it and for userspace being able to set sane | |
12 | tuning values there it has to know about the transition latency. | |
13 | ||
14 | Signed-off-by: Thomas Renninger <trenn@suse.de> | |
15 | ||
16 | --- | |
17 | Documentation/cpu-freq/user-guide.txt | 12 ++++++++++++ | |
18 | drivers/cpufreq/cpufreq.c | 3 +++ | |
19 | 2 files changed, 15 insertions(+) | |
20 | ||
21 | Index: linux-2.6.27/Documentation/cpu-freq/user-guide.txt | |
22 | =================================================================== | |
23 | --- linux-2.6.27.orig/Documentation/cpu-freq/user-guide.txt | |
24 | +++ linux-2.6.27/Documentation/cpu-freq/user-guide.txt | |
25 | @@ -142,6 +142,18 @@ cpuinfo_min_freq : this file shows the | |
26 | frequency the processor can run at(in kHz) | |
27 | cpuinfo_max_freq : this file shows the maximum operating | |
28 | frequency the processor can run at(in kHz) | |
29 | +cpuinfo_transition_latency The time it takes on this CPU to | |
30 | + switch between two frequencies in nano | |
31 | + seconds. If unknown or known to be | |
32 | + that high that the driver does not | |
33 | + work with the ondemand governor, -1 | |
34 | + (CPUFREQ_ETERNAL) will be returned. | |
35 | + Using this information can be useful | |
36 | + to choose an appropriate polling | |
37 | + frequency for a kernel governor or | |
38 | + userspace daemon. Make sure to not | |
39 | + switch the frequency too often | |
40 | + resulting in performance loss. | |
41 | scaling_driver : this file shows what cpufreq driver is | |
42 | used to set the frequency on this CPU | |
43 | ||
44 | Index: linux-2.6.27/drivers/cpufreq/cpufreq.c | |
45 | =================================================================== | |
46 | --- linux-2.6.27.orig/drivers/cpufreq/cpufreq.c | |
47 | +++ linux-2.6.27/drivers/cpufreq/cpufreq.c | |
48 | @@ -455,6 +455,7 @@ static ssize_t show_##file_name \ | |
49 | ||
50 | show_one(cpuinfo_min_freq, cpuinfo.min_freq); | |
51 | show_one(cpuinfo_max_freq, cpuinfo.max_freq); | |
52 | +show_one(cpuinfo_transition_latency, cpuinfo.transition_latency); | |
53 | show_one(scaling_min_freq, min); | |
54 | show_one(scaling_max_freq, max); | |
55 | show_one(scaling_cur_freq, cur); | |
56 | @@ -660,6 +661,7 @@ __ATTR(_name, 0644, show_##_name, store_ | |
57 | define_one_ro0400(cpuinfo_cur_freq); | |
58 | define_one_ro(cpuinfo_min_freq); | |
59 | define_one_ro(cpuinfo_max_freq); | |
60 | +define_one_ro(cpuinfo_transition_latency); | |
61 | define_one_ro(scaling_available_governors); | |
62 | define_one_ro(scaling_driver); | |
63 | define_one_ro(scaling_cur_freq); | |
64 | @@ -673,6 +675,7 @@ define_one_rw(scaling_setspeed); | |
65 | static struct attribute *default_attrs[] = { | |
66 | &cpuinfo_min_freq.attr, | |
67 | &cpuinfo_max_freq.attr, | |
68 | + &cpuinfo_transition_latency.attr, | |
69 | &scaling_min_freq.attr, | |
70 | &scaling_max_freq.attr, | |
71 | &affected_cpus.attr, |