[CPUFREQ] Only set sampling_rate_max deprecated, sampling_rate_min is useful

Update the documentation accordingly.
Cleanup and use printk_once.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
This commit is contained in:
Thomas Renninger 2009-04-22 13:48:31 +02:00 committed by Dave Jones
parent 86e13684aa
commit 4f4d1ad6ee
3 changed files with 18 additions and 43 deletions

View file

@ -119,10 +119,6 @@ want the kernel to look at the CPU usage and to make decisions on
what to do about the frequency. Typically this is set to values of what to do about the frequency. Typically this is set to values of
around '10000' or more. It's default value is (cmp. with users-guide.txt): around '10000' or more. It's default value is (cmp. with users-guide.txt):
transition_latency * 1000 transition_latency * 1000
The lowest value you can set is:
transition_latency * 100 or it may get restricted to a value where it
makes not sense for the kernel anymore to poll that often which depends
on your HZ config variable (HZ=1000: max=20000us, HZ=250: max=5000).
Be aware that transition latency is in ns and sampling_rate is in us, so you Be aware that transition latency is in ns and sampling_rate is in us, so you
get the same sysfs value by default. get the same sysfs value by default.
Sampling rate should always get adjusted considering the transition latency Sampling rate should always get adjusted considering the transition latency
@ -131,14 +127,20 @@ in the bash (as said, 1000 is default), do:
echo `$(($(cat cpuinfo_transition_latency) * 750 / 1000)) \ echo `$(($(cat cpuinfo_transition_latency) * 750 / 1000)) \
>ondemand/sampling_rate >ondemand/sampling_rate
show_sampling_rate_(min|max): THIS INTERFACE IS DEPRECATED, DON'T USE IT. show_sampling_rate_min:
You can use wider ranges now and the general The sampling rate is limited by the HW transition latency:
cpuinfo_transition_latency variable (cmp. with user-guide.txt) can be transition_latency * 100
used to obtain exactly the same info: Or by kernel restrictions:
show_sampling_rate_min = transtition_latency * 500 / 1000 If CONFIG_NO_HZ is set, the limit is 10ms fixed.
show_sampling_rate_max = transtition_latency * 500000 / 1000 If CONFIG_NO_HZ is not set or no_hz=off boot parameter is used, the
(divided by 1000 is to illustrate that sampling rate is in us and limits depend on the CONFIG_HZ option:
transition latency is exported ns). HZ=1000: min=20000us (20ms)
HZ=250: min=80000us (80ms)
HZ=100: min=200000us (200ms)
The highest value of kernel and HW latency restrictions is shown and
used as the minimum sampling rate.
show_sampling_rate_max: THIS INTERFACE IS DEPRECATED, DON'T USE IT.
up_threshold: defines what the average CPU usage between the samplings up_threshold: defines what the average CPU usage between the samplings
of 'sampling_rate' needs to be for the kernel to make a decision on of 'sampling_rate' needs to be for the kernel to make a decision on

View file

@ -167,26 +167,13 @@ static struct notifier_block dbs_cpufreq_notifier_block = {
/************************** sysfs interface ************************/ /************************** sysfs interface ************************/
static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)
{ {
static int print_once; printk_once(KERN_INFO "CPUFREQ: conservative sampling_rate_max "
"sysfs file is deprecated - used by: %s\n", current->comm);
if (!print_once) {
printk(KERN_INFO "CPUFREQ: conservative sampling_rate_max "
"sysfs file is deprecated - used by: %s\n",
current->comm);
print_once = 1;
}
return sprintf(buf, "%u\n", -1U); return sprintf(buf, "%u\n", -1U);
} }
static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf) static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf)
{ {
static int print_once;
if (!print_once) {
printk(KERN_INFO "CPUFREQ: conservative sampling_rate_max "
"sysfs file is deprecated - used by: %s\n", current->comm);
print_once = 1;
}
return sprintf(buf, "%u\n", min_sampling_rate); return sprintf(buf, "%u\n", min_sampling_rate);
} }

View file

@ -205,27 +205,13 @@ static void ondemand_powersave_bias_init(void)
/************************** sysfs interface ************************/ /************************** sysfs interface ************************/
static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)
{ {
static int print_once; printk_once(KERN_INFO "CPUFREQ: ondemand sampling_rate_max "
"sysfs file is deprecated - used by: %s\n", current->comm);
if (!print_once) {
printk(KERN_INFO "CPUFREQ: ondemand sampling_rate_max "
"sysfs file is deprecated - used by: %s\n",
current->comm);
print_once = 1;
}
return sprintf(buf, "%u\n", -1U); return sprintf(buf, "%u\n", -1U);
} }
static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf) static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf)
{ {
static int print_once;
if (!print_once) {
printk(KERN_INFO "CPUFREQ: ondemand sampling_rate_min "
"sysfs file is deprecated - used by: %s\n",
current->comm);
print_once = 1;
}
return sprintf(buf, "%u\n", min_sampling_rate); return sprintf(buf, "%u\n", min_sampling_rate);
} }