ia64/linux-2.6.18-xen.hg

changeset 304:98de2b149423

cpufreq: minor clean-ups for ondemand governor on Xen.

The cpufreq ondemand governor patch for Xen included some out
of order code and some test code; re-order the code to assign
a variable before passing it to a function and remove the
test code.

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
author Keir Fraser <keir@xensource.com>
date Mon Nov 05 10:40:31 2007 +0000 (2007-11-05)
parents d827dfc6593e
children a37a8c474d8b
files drivers/cpufreq/cpufreq_ondemand.c
line diff
     1.1 --- a/drivers/cpufreq/cpufreq_ondemand.c	Thu Nov 01 09:07:45 2007 -0600
     1.2 +++ b/drivers/cpufreq/cpufreq_ondemand.c	Mon Nov 05 10:40:31 2007 +0000
     1.3 @@ -96,6 +96,7 @@ static inline cputime64_t get_cpu_idle_t
     1.4  	return retval;
     1.5  }
     1.6  
     1.7 +
     1.8  /************************** sysfs interface ************************/
     1.9  static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)
    1.10  {
    1.11 @@ -281,15 +282,16 @@ static int dbs_calc_load(struct cpu_dbs_
    1.12  	unsigned int j;
    1.13  	cpumask_t cpumap;
    1.14  
    1.15 +	policy = this_dbs_info->cur_policy;
    1.16 +	cpumap = policy->cpus;
    1.17 +
    1.18  	op.cmd = XENPF_getidletime;
    1.19  	set_xen_guest_handle(op.u.getidletime.cpumap_bitmap, (uint8_t *) cpus_addr(cpumap));
    1.20 -	op.u.getidletime.cpumap_nr_cpus = NR_CPUS;// num_online_cpus();
    1.21 +	op.u.getidletime.cpumap_nr_cpus = NR_CPUS;
    1.22  	set_xen_guest_handle(op.u.getidletime.idletime, idletime);
    1.23  	if (HYPERVISOR_platform_op(&op))
    1.24  		return 200;
    1.25  
    1.26 -	policy = this_dbs_info->cur_policy;
    1.27 -	cpumap = policy->cpus;
    1.28  	for_each_cpu_mask(j, cpumap) {
    1.29  		cputime64_t total_idle_nsecs, tmp_idle_nsecs;
    1.30  		cputime64_t total_wall_nsecs, tmp_wall_nsecs;