Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234951
b: refs/heads/master
c: 57df557
h: refs/heads/master
i:
  234949: 0695587
  234947: 37f0bc0
  234943: a94e191
v: v3
  • Loading branch information
Tejun Heo committed Jan 26, 2011
1 parent fd68b95 commit 53ad36c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 37 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: bcb6d9161d1720cf68c7f4de0630e91cb95ee60c
refs/heads/master: 57df5573a56322e6895451f759c19e875252817d
22 changes: 3 additions & 19 deletions trunk/drivers/cpufreq/cpufreq_conservative.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */
*/
static DEFINE_MUTEX(dbs_mutex);

static struct workqueue_struct *kconservative_wq;

static struct dbs_tuners {
unsigned int sampling_rate;
unsigned int sampling_down_factor;
Expand Down Expand Up @@ -560,7 +558,7 @@ static void do_dbs_timer(struct work_struct *work)

dbs_check_cpu(dbs_info);

queue_delayed_work_on(cpu, kconservative_wq, &dbs_info->work, delay);
schedule_delayed_work_on(cpu, &dbs_info->work, delay);
mutex_unlock(&dbs_info->timer_mutex);
}

Expand All @@ -572,8 +570,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)

dbs_info->enable = 1;
INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
queue_delayed_work_on(dbs_info->cpu, kconservative_wq, &dbs_info->work,
delay);
schedule_delayed_work_on(dbs_info->cpu, &dbs_info->work, delay);
}

static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
Expand Down Expand Up @@ -716,25 +713,12 @@ struct cpufreq_governor cpufreq_gov_conservative = {

static int __init cpufreq_gov_dbs_init(void)
{
int err;

kconservative_wq = create_workqueue("kconservative");
if (!kconservative_wq) {
printk(KERN_ERR "Creation of kconservative failed\n");
return -EFAULT;
}

err = cpufreq_register_governor(&cpufreq_gov_conservative);
if (err)
destroy_workqueue(kconservative_wq);

return err;
return cpufreq_register_governor(&cpufreq_gov_conservative);
}

static void __exit cpufreq_gov_dbs_exit(void)
{
cpufreq_unregister_governor(&cpufreq_gov_conservative);
destroy_workqueue(kconservative_wq);
}


Expand Down
20 changes: 3 additions & 17 deletions trunk/drivers/cpufreq/cpufreq_ondemand.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */
*/
static DEFINE_MUTEX(dbs_mutex);

static struct workqueue_struct *kondemand_wq;

static struct dbs_tuners {
unsigned int sampling_rate;
unsigned int up_threshold;
Expand Down Expand Up @@ -667,7 +665,7 @@ static void do_dbs_timer(struct work_struct *work)
__cpufreq_driver_target(dbs_info->cur_policy,
dbs_info->freq_lo, CPUFREQ_RELATION_H);
}
queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay);
schedule_delayed_work_on(cpu, &dbs_info->work, delay);
mutex_unlock(&dbs_info->timer_mutex);
}

Expand All @@ -681,8 +679,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)

dbs_info->sample_type = DBS_NORMAL_SAMPLE;
INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work,
delay);
schedule_delayed_work_on(dbs_info->cpu, &dbs_info->work, delay);
}

static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
Expand Down Expand Up @@ -814,7 +811,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,

static int __init cpufreq_gov_dbs_init(void)
{
int err;
cputime64_t wall;
u64 idle_time;
int cpu = get_cpu();
Expand All @@ -838,22 +834,12 @@ static int __init cpufreq_gov_dbs_init(void)
MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10);
}

kondemand_wq = create_workqueue("kondemand");
if (!kondemand_wq) {
printk(KERN_ERR "Creation of kondemand failed\n");
return -EFAULT;
}
err = cpufreq_register_governor(&cpufreq_gov_ondemand);
if (err)
destroy_workqueue(kondemand_wq);

return err;
return cpufreq_register_governor(&cpufreq_gov_ondemand);
}

static void __exit cpufreq_gov_dbs_exit(void)
{
cpufreq_unregister_governor(&cpufreq_gov_ondemand);
destroy_workqueue(kondemand_wq);
}


Expand Down

0 comments on commit 53ad36c

Please sign in to comment.