aboutsummaryrefslogtreecommitdiffstats
path: root/xen/drivers/cpufreq
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-04-12 17:33:47 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-04-12 17:33:47 +0100
commit7cc4840cb2ec55f784800543d7ec49655f049654 (patch)
tree4d5dc5cc1cc120315441119f0321f22ceee5d091 /xen/drivers/cpufreq
parente6984111fd761971c8575e2ece7c0fc2c8313e68 (diff)
downloadxen-7cc4840cb2ec55f784800543d7ec49655f049654.tar.gz
xen-7cc4840cb2ec55f784800543d7ec49655f049654.tar.bz2
xen-7cc4840cb2ec55f784800543d7ec49655f049654.zip
cpufreq: fix racing issue for cpu hotplug
To eliminate racing between dbs timer handler and cpufreq_del_cpu, using kill_timer instead of stop_timer to make sure timer handler execution finished before other stuff in cpufreq_del_cpu. BTW, fix a lost point of cpufreq_statistic_lock taking sequence. Signed-off-by: Wei Gang <gang.wei@intel.com>
Diffstat (limited to 'xen/drivers/cpufreq')
-rw-r--r--xen/drivers/cpufreq/cpufreq_ondemand.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/xen/drivers/cpufreq/cpufreq_ondemand.c b/xen/drivers/cpufreq/cpufreq_ondemand.c
index dd4f6c45c1..f69dd7a19c 100644
--- a/xen/drivers/cpufreq/cpufreq_ondemand.c
+++ b/xen/drivers/cpufreq/cpufreq_ondemand.c
@@ -189,9 +189,8 @@ static void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
{
dbs_info->enable = 1;
- if ( !dbs_timer[dbs_info->cpu].function )
- init_timer(&dbs_timer[dbs_info->cpu], do_dbs_timer,
- (void *)dbs_info, dbs_info->cpu);
+ init_timer(&dbs_timer[dbs_info->cpu], do_dbs_timer,
+ (void *)dbs_info, dbs_info->cpu);
set_timer(&dbs_timer[dbs_info->cpu], NOW()+dbs_tuners_ins.sampling_rate);
@@ -206,7 +205,7 @@ static void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
{
dbs_info->enable = 0;
dbs_info->stoppable = 0;
- stop_timer(&dbs_timer[dbs_info->cpu]);
+ kill_timer(&dbs_timer[dbs_info->cpu]);
}
int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event)