From: Chris J Arges <arges@li...> - 2008-05-20 20:54:18
These patches addresses the issue of oprofile causing a kernel oops
when cpus are taken offline or put online during profiling.
These patches add a basic cpu hotplug callback function as well as an
entry in struct oprofile_operations for arch specific cpu hotplug
callback code. The patches add the functions alloc_cpu_buffer,
online_cpu, and offline_cpu to cpu_buffer.c. In addition, oprof.c has
been modified to call online_cpu, offline_cpu on corresponding cpu
hotplug events. However, this is only done when oprofile is started, and
is checked in the cpu hotplug handler. The online_cpu function allocs a
cpu buffer for the new cpu and schedules the work. The offline_cpu
cancels the work, flushes scheduled work and frees the cpu buffer.
I ran some tests on my POWER machine and found that oprofile no longer
crashes when taking cpu's offline or online.
However, I know there is work to be done on the architecture dependent
side, as well as making sure that using the --separate=cpu flag does
indeed separate cpus properly even when they are being dynamically
Chris J Arges
IBM Linux Technology Center