diff --git a/xen/drivers/cpufreq/cpufreq_ondemand.c b/xen/drivers/cpufreq/cpufreq_ondemand.c index 06cfc88d30..f62678fa61 100644 --- a/xen/drivers/cpufreq/cpufreq_ondemand.c +++ b/xen/drivers/cpufreq/cpufreq_ondemand.c @@ -115,11 +115,12 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) cur_ns = NOW(); total_ns = cur_ns - this_dbs_info->prev_cpu_wall; - this_dbs_info->prev_cpu_wall = NOW(); if (total_ns < MIN_DBS_INTERVAL) return; + this_dbs_info->prev_cpu_wall = cur_ns; + /* Get Idle Time */ for_each_cpu(j, policy->cpus) { uint64_t idle_ns, total_idle_ns;