diff options
author | Thomas Renninger <trenn@suse.de> | 2009-02-03 19:17:41 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2009-02-24 22:47:31 -0500 |
commit | ed12978453a3845c947695e7ad32bb3ede444813 (patch) | |
tree | 6fcec1eaa023fd2cadce8e82a17b9b890f59fd88 | |
parent | 0e64a0c982c06a6b8f5e2a7f29eb108fdf257b2f (diff) |
[CPUFREQ] Introduce /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_transition_latency
It's not only useful for the ondemand and conservative governors, but
also for userspace daemons to know about the HW transition latency of
the CPU.
It is especially useful for userspace to know about this value when
the ondemand or conservative governors are run. The sampling rate
control value depends on it and for userspace being able to set sane
tuning values there it has to know about the transition latency.
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
-rw-r--r-- | Documentation/cpu-freq/user-guide.txt | 12 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/cpu-freq/user-guide.txt b/Documentation/cpu-freq/user-guide.txt index 917918f84fc7..75f41193f3e1 100644 --- a/Documentation/cpu-freq/user-guide.txt +++ b/Documentation/cpu-freq/user-guide.txt | |||
@@ -152,6 +152,18 @@ cpuinfo_min_freq : this file shows the minimum operating | |||
152 | frequency the processor can run at(in kHz) | 152 | frequency the processor can run at(in kHz) |
153 | cpuinfo_max_freq : this file shows the maximum operating | 153 | cpuinfo_max_freq : this file shows the maximum operating |
154 | frequency the processor can run at(in kHz) | 154 | frequency the processor can run at(in kHz) |
155 | cpuinfo_transition_latency The time it takes on this CPU to | ||
156 | switch between two frequencies in nano | ||
157 | seconds. If unknown or known to be | ||
158 | that high that the driver does not | ||
159 | work with the ondemand governor, -1 | ||
160 | (CPUFREQ_ETERNAL) will be returned. | ||
161 | Using this information can be useful | ||
162 | to choose an appropriate polling | ||
163 | frequency for a kernel governor or | ||
164 | userspace daemon. Make sure to not | ||
165 | switch the frequency too often | ||
166 | resulting in performance loss. | ||
155 | scaling_driver : this file shows what cpufreq driver is | 167 | scaling_driver : this file shows what cpufreq driver is |
156 | used to set the frequency on this CPU | 168 | used to set the frequency on this CPU |
157 | 169 | ||
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 1867dac35aff..6fe466efb0b5 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -452,6 +452,7 @@ static ssize_t show_##file_name \ | |||
452 | 452 | ||
453 | show_one(cpuinfo_min_freq, cpuinfo.min_freq); | 453 | show_one(cpuinfo_min_freq, cpuinfo.min_freq); |
454 | show_one(cpuinfo_max_freq, cpuinfo.max_freq); | 454 | show_one(cpuinfo_max_freq, cpuinfo.max_freq); |
455 | show_one(cpuinfo_transition_latency, cpuinfo.transition_latency); | ||
455 | show_one(scaling_min_freq, min); | 456 | show_one(scaling_min_freq, min); |
456 | show_one(scaling_max_freq, max); | 457 | show_one(scaling_max_freq, max); |
457 | show_one(scaling_cur_freq, cur); | 458 | show_one(scaling_cur_freq, cur); |
@@ -659,6 +660,7 @@ __ATTR(_name, 0644, show_##_name, store_##_name) | |||
659 | define_one_ro0400(cpuinfo_cur_freq); | 660 | define_one_ro0400(cpuinfo_cur_freq); |
660 | define_one_ro(cpuinfo_min_freq); | 661 | define_one_ro(cpuinfo_min_freq); |
661 | define_one_ro(cpuinfo_max_freq); | 662 | define_one_ro(cpuinfo_max_freq); |
663 | define_one_ro(cpuinfo_transition_latency); | ||
662 | define_one_ro(scaling_available_governors); | 664 | define_one_ro(scaling_available_governors); |
663 | define_one_ro(scaling_driver); | 665 | define_one_ro(scaling_driver); |
664 | define_one_ro(scaling_cur_freq); | 666 | define_one_ro(scaling_cur_freq); |
@@ -672,6 +674,7 @@ define_one_rw(scaling_setspeed); | |||
672 | static struct attribute *default_attrs[] = { | 674 | static struct attribute *default_attrs[] = { |
673 | &cpuinfo_min_freq.attr, | 675 | &cpuinfo_min_freq.attr, |
674 | &cpuinfo_max_freq.attr, | 676 | &cpuinfo_max_freq.attr, |
677 | &cpuinfo_transition_latency.attr, | ||
675 | &scaling_min_freq.attr, | 678 | &scaling_min_freq.attr, |
676 | &scaling_max_freq.attr, | 679 | &scaling_max_freq.attr, |
677 | &affected_cpus.attr, | 680 | &affected_cpus.attr, |