[ Removed CC to "Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>" (email-adsress seems not to exist) ] Indeed, the patch fixes the cpufreq issue here - Thanks. Feel free to add: Tested-by: Sedat Dilek <sedat.dilek@xxxxxxxxx> - Sedat - P.S.: I have attached the patch from cpufreq ML, so it is available from <patchwork.kernel.org>. On Mon, May 31, 2010 at 8:43 AM, Sedat Dilek <sedat.dilek@xxxxxxxxxxxxxx> wrote: > Damn! > Sorry, I have found the following fix at cpufreq ML from Dmitry Monakhov [1]. > > I will try it and report. > > - Sedat - > > [1] "[PATCH] cpufreq: call nr_iowait_cpu with disabled preemption" > http://www.spinics.net/lists/cpufreq/msg01631.html > > On Mon, May 31, 2010 at 8:27 AM, Sedat Dilek <sedat.dilek@xxxxxxxxxxxxxx> wrote: >> Hi, >> >> with 2.6.35-rc1 I get a cpufreq-related Call trace on startup on a >> 32-bit Debian/sid system. >> >> Below I added (see investigations at the end): >> >> 1. the version of cpufrequtils I am using >> 2. an output of cpufreq-related loaded kernel-modules >> 3. an output of cpufreq-related setting in kernel-config >> >> Furthermore, I have attched the full dmesg output and kernel-config file. >> >> Here is the Call trace: >> >> [ 31.647049] BUG: using smp_processor_id() in preemptible [00000000] >> code: cpufreq-set/2344 >> [ 31.647299] caller is nr_iowait_cpu+0xb/0x1a >> [ 31.647303] Pid: 2344, comm: cpufreq-set Not tainted >> 2.6.35-rc1-iniza-686-kms #1 >> [ 31.647306] Call Trace: >> [ 31.647314] [<c111fdd9>] ? debug_smp_processor_id+0xa5/0xb8 >> [ 31.647319] [<c1022f93>] ? nr_iowait_cpu+0xb/0x1a >> [ 31.647325] [<c104a93c>] ? update_ts_time_stats+0x36/0x92 >> [ 31.647329] [<c1045fcb>] ? ktime_get+0x5b/0xd9 >> [ 31.647333] [<c104aae9>] ? get_cpu_idle_time_us+0x36/0x62 >> [ 31.647340] [<f94e433d>] ? get_cpu_idle_time+0x12/0x127 [cpufreq_ondemand] >> [ 31.647345] [<c10dea11>] ? sysfs_add_file_mode+0x48/0x66 >> [ 31.647350] [<c10e0827>] ? internal_create_group+0xcf/0x134 >> [ 31.647355] [<f94e4a3b>] ? cpufreq_governor_dbs+0xaa/0x2a3 >> [cpufreq_ondemand] >> [ 31.647361] [<c119d94a>] ? __cpufreq_governor+0x2c/0x63 >> [ 31.647365] [<c119e80a>] ? __cpufreq_set_policy+0xea/0x11d >> [ 31.647370] [<c119ea74>] ? store_scaling_governor+0x58/0x7c >> [ 31.647375] [<c119ee09>] ? handle_update+0x0/0x8 >> [ 31.647381] [<c1225d70>] ? _raw_spin_unlock_irqrestore+0x22/0x2c >> [ 31.647385] [<c119ea1c>] ? store_scaling_governor+0x0/0x7c >> [ 31.647389] [<c119e708>] ? store+0x3c/0x54 >> [ 31.647393] [<c10de76d>] ? sysfs_write_file+0xb8/0xe5 >> [ 31.647397] [<c10de6b5>] ? sysfs_write_file+0x0/0xe5 >> [ 31.647403] [<c109f7c6>] ? vfs_write+0x7f/0xda >> [ 31.647408] [<c101dad8>] ? do_page_fault+0x1fb/0x25f >> [ 31.647412] [<c109f8b4>] ? sys_write+0x3c/0x60 >> [ 31.647417] [<c1002e18>] ? sysenter_do_call+0x12/0x28 >> >> Hope this helps fixing the problem. >> >> Kind Regards, >> - Sedat - >> >> P.S.: >> Recently I watched a video with a speeh of Greg K-H [1] and extracted >> the maintainers/contributors via: >> >> $ ./scripts/get_maintainer.pl -f drivers/cpuidle/governors/menu.c <--- >> nr_iowait_cpu() >> $ ./scripts/get_maintainer.pl -f drivers/cpufreq/cpufreq_ondemand.c >> <--- [cpufreq_ondemand] >> >> [1] Write and Submit your first Linux kernel Patch: >> http://fosdem.org/2010/schedule/events/linuxkernelpatch >> >> ------ INVESTIGATIONS ----- >> >> $ env COLUMNS=120 dpkg -l | grep -i cpufreq >> ii cpufrequtils 007-1 utilities to >> deal with the cpufreq Linux kernel feature >> ii libcpufreq0 007-1 shared library >> to deal with the cpufreq Linux kernel feature >> >> $ sudo lsmod | grep freq | sort >> acpi_cpufreq 4343 1 >> cpufreq_conservative 6260 0 >> cpufreq_ondemand 5810 2 >> cpufreq_performance 590 0 >> cpufreq_powersave 582 0 >> cpufreq_stats 1969 0 >> freq_table 1647 3 acpi_cpufreq,cpufreq_ondemand,cpufreq_stats >> mperf 899 1 acpi_cpufreq >> processor 22099 3 acpi_cpufreq >> >> $ grep -i freq /boot/config-2.6.35-rc1-iniza-686-kms | grep -i cpu >> # CPU Frequency scaling >> CONFIG_CPU_FREQ=y >> CONFIG_CPU_FREQ_TABLE=m >> # CONFIG_CPU_FREQ_DEBUG is not set >> CONFIG_CPU_FREQ_STAT=m >> # CONFIG_CPU_FREQ_STAT_DETAILS is not set >> # CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set >> # CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set >> CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y >> # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set >> # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set >> CONFIG_CPU_FREQ_GOV_PERFORMANCE=m >> CONFIG_CPU_FREQ_GOV_POWERSAVE=m >> CONFIG_CPU_FREQ_GOV_USERSPACE=y >> CONFIG_CPU_FREQ_GOV_ONDEMAND=m >> CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m >> # CPUFreq processor drivers >> # CONFIG_X86_PCC_CPUFREQ is not set >> CONFIG_X86_ACPI_CPUFREQ=m >> CONFIG_X86_CPUFREQ_NFORCE2=m >> >
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: [<ffffffff812de2ae>] debug_smp_processor_id+0xc2/0xdc [<ffffffff8102baea>] nr_iowait_cpu+0x1a/0x30 [<ffffffff810671b3>] update_ts_time_stats+0x3c/0x77 [<ffffffff81062894>] ? ktime_get+0x5e/0x98 [<ffffffff8106737c>] get_cpu_idle_time_us+0x49/0x68 [<ffffffffa004d4d1>] get_cpu_idle_time+0x21/0xa9 [cpufreq_ondemand] [<ffffffffa004dc7f>] cpufreq_governor_dbs+0xcd/0x316 [cpufreq_ondemand] [<ffffffff813d6b46>] __cpufreq_governor+0x89/0xc7 [<ffffffff813d7936>] __cpufreq_set_policy+0x1ad/0x227 [<ffffffff813d7dee>] store_scaling_governor+0x1a0/0x1e8 [<ffffffff813d8058>] ? handle_update+0x0/0x38 Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxxx> --- 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