Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1729
b: refs/heads/master
c: 6fe7116
h: refs/heads/master
i:
  1727: b1ba0d3
v: v3
  • Loading branch information
Dave Jones committed Jun 1, 2005
1 parent 4dcceb1 commit 8c3e1f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8282864a96ef0a7b88ee9e4b357e08504131394d
refs/heads/master: 6fe711658fcf92d39d84c0b7e6332ed6625dc520
14 changes: 6 additions & 8 deletions trunk/drivers/cpufreq/cpufreq_ondemand.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ static unsigned int def_sampling_rate;
#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)
#define DEF_SAMPLING_DOWN_FACTOR (10)
#define TRANSITION_LATENCY_LIMIT (10 * 1000)
#define sampling_rate_in_HZ(x) (((x * HZ) < (1000 * 1000))?1:((x * HZ) / (1000 * 1000)))

static void do_dbs_timer(void *data);

Expand Down Expand Up @@ -281,7 +280,7 @@ static void dbs_check_cpu(int cpu)
/* Scale idle ticks by 100 and compare with up and down ticks */
idle_ticks *= 100;
up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) *
sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate);
usecs_to_jiffies(dbs_tuners_ins.sampling_rate);

if (idle_ticks < up_idle_ticks) {
__cpufreq_driver_target(policy, policy->max,
Expand Down Expand Up @@ -328,7 +327,7 @@ static void dbs_check_cpu(int cpu)
freq_down_sampling_rate = dbs_tuners_ins.sampling_rate *
dbs_tuners_ins.sampling_down_factor;
down_idle_ticks = (100 - dbs_tuners_ins.down_threshold) *
sampling_rate_in_HZ(freq_down_sampling_rate);
usecs_to_jiffies(freq_down_sampling_rate);

if (idle_ticks > down_idle_ticks ) {
freq_down_step = (5 * policy->max) / 100;
Expand All @@ -348,19 +347,18 @@ static void do_dbs_timer(void *data)
{
int i;
down(&dbs_sem);
for (i = 0; i < NR_CPUS; i++)
if (cpu_online(i))
dbs_check_cpu(i);
for_each_online_cpu(i)
dbs_check_cpu(i);
schedule_delayed_work(&dbs_work,
sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate));
usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
up(&dbs_sem);
}

static inline void dbs_timer_init(void)
{
INIT_WORK(&dbs_work, do_dbs_timer, NULL);
schedule_delayed_work(&dbs_work,
sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate));
usecs_to_jiffies(dbs_tuners_ins.sampling_rate));
return;
}

Expand Down

0 comments on commit 8c3e1f2

Please sign in to comment.