This patch fix complain from preemptive debug BUG: using smp_processor_id() in preemptible [00000000] code: S06cpuspeed/655 caller is nr_iowait_cpu+0x1a/0x30 Pid: 655, comm: S06cpuspeed Not tainted 2.6.34-quota-cleanups #46 Call Trace: [] debug_smp_processor_id+0xc2/0xdc [] nr_iowait_cpu+0x1a/0x30 [] update_ts_time_stats+0x3c/0x77 [] ? ktime_get+0x5e/0x98 [] get_cpu_idle_time_us+0x49/0x68 [] get_cpu_idle_time+0x21/0xa9 [cpufreq_ondemand] [] cpufreq_governor_dbs+0xcd/0x316 [cpufreq_ondemand] [] __cpufreq_governor+0x89/0xc7 [] __cpufreq_set_policy+0x1ad/0x227 [] store_scaling_governor+0x1a0/0x1e8 [] ? handle_update+0x0/0x38 Signed-off-by: Dmitry Monakhov --- drivers/cpufreq/cpufreq_ondemand.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index e131421..c1b1a96 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -363,6 +363,7 @@ static ssize_t store_ignore_nice_load(struct kobject *a, struct attribute *b, dbs_tuners_ins.ignore_nice = input; /* we need to re-evaluate prev_cpu_idle */ + get_cpu(); for_each_online_cpu(j) { struct cpu_dbs_info_s *dbs_info; dbs_info = &per_cpu(od_cpu_dbs_info, j); @@ -372,6 +373,7 @@ static ssize_t store_ignore_nice_load(struct kobject *a, struct attribute *b, dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice; } + put_cpu(); mutex_unlock(&dbs_mutex); return count; @@ -493,9 +495,10 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) j_dbs_info = &per_cpu(od_cpu_dbs_info, j); + get_cpu(); cur_idle_time = get_cpu_idle_time(j, &cur_wall_time); cur_iowait_time = get_cpu_iowait_time(j, &cur_wall_time); - + put_cpu(); wall_time = (unsigned int) cputime64_sub(cur_wall_time, j_dbs_info->prev_cpu_wall); j_dbs_info->prev_cpu_wall = cur_wall_time; @@ -695,6 +698,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, } dbs_enable++; + get_cpu(); for_each_cpu(j, policy->cpus) { struct cpu_dbs_info_s *j_dbs_info; j_dbs_info = &per_cpu(od_cpu_dbs_info, j); @@ -708,6 +712,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, } } this_dbs_info->cpu = cpu; + put_cpu(); ondemand_powersave_bias_init_cpu(cpu); /* * Start the timerschedule work, when this governor -- 1.6.6.1