OpenCloudOS-Kernel/drivers/oprofile
Santosh Shilimkar 4ac3dbec80 oprofile: Fix the hang while taking the cpu offline
The kernel build with CONFIG_OPROFILE and CPU_HOTPLUG enabled.
The oprofile is initialised using system timer in absence of hardware
counters supports. Oprofile isn't started from userland.

In this setup while doing a CPU offline the kernel hangs in infinite
for loop inside lock_hrtimer_base() function

This happens because as part of oprofile_cpu_notify(, it tries to
stop an hrtimer which was never started. These per-cpu hrtimers
are started when the oprfile is started.
	echo 1	> /dev/oprofile/enable

This problem also existwhen the cpu is booted with maxcpus parameter
set. When bringing the remaining cpus online the timers are started
even if oprofile is not yet enabled.

This patch fix this issue by adding a state variable so that
these hrtimer start/stop is only attempted when oprofile is
started

For stable kernels v2.6.35.y and v2.6.36.y.

Reported-by: Jan Sebastien <s-jan@ti.com>
Tested-by: sricharan <r.sricharan@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: stable@kernel.org
Signed-off-by: Robert Richter <robert.richter@amd.com>
2010-10-29 11:52:53 +02:00
..
buffer_sync.c oprofile: fix crash when accessing freed task structs 2010-08-25 09:09:09 +02:00
buffer_sync.h cpumask: modifiy oprofile initialization 2009-01-22 14:37:06 +01:00
cpu_buffer.c oprofile: fix crash when accessing freed task structs 2010-08-25 09:09:09 +02:00
cpu_buffer.h percpu: make percpu symbols in oprofile unique 2009-10-29 22:34:13 +09:00
event_buffer.c oprofile: make event buffer nonseekable 2010-07-26 10:58:24 +02:00
event_buffer.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile 2008-10-23 10:05:40 -07:00
oprof.c oprofile: disable write access to oprofilefs while profiler is running 2010-10-12 17:25:06 +02:00
oprof.h oprofile: disable write access to oprofilefs while profiler is running 2010-10-12 17:25:06 +02:00
oprofile_files.c oprofile: disable write access to oprofilefs while profiler is running 2010-10-12 17:25:06 +02:00
oprofile_perf.c oprofile: make !CONFIG_PM function stubs static inline 2010-10-15 12:47:18 +02:00
oprofile_stats.c percpu: make percpu symbols in oprofile unique 2009-10-29 22:34:13 +09:00
oprofile_stats.h oprofile: Adding switch counter to oprofile statistic variables 2009-07-20 16:43:21 +02:00
oprofilefs.c oprofile: disable write access to oprofilefs while profiler is running 2010-10-12 17:25:06 +02:00
timer_int.c oprofile: Fix the hang while taking the cpu offline 2010-10-29 11:52:53 +02:00