]> git.karo-electronics.de Git - karo-tx-linux.git/commit
oprofile: Fix the hang while taking the cpu offline
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Wed, 27 Oct 2010 15:17:15 +0000 (11:17 -0400)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:06 +0000 (23:40 +0100)
commit5b28c745f7fd51718315cec9e4d34204c2513ca4
tree4b501cc91a1d1943a5968de7489b24cdf30a26b6
parentec76a70ac2f733b36f71866935071b0ba1ff95de
oprofile: Fix the hang while taking the cpu offline

commit 4ac3dbec800d93485a5c84e37af676278eea657c upstream.

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>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/oprofile/timer_int.c