RE: [PATCH] perf_counter: Fix a race on perf_counter_ctx

From: Peter Zijlstra
Date: Tue Aug 18 2009 - 08:59:20 EST


On Tue, 2009-08-18 at 13:49 +0100, Metzger, Markus T wrote:
> Hi Ingo, Peter,
>
> Did you say that branch tracing is working for you?
>
> On my system, the kernel hangs.
>
> Could it be that it simply takes too long to copy the trace? When I set the number
> of samples to 10, everything seems to work OK. When I increase that number to 1000,
> the kernel is getting very slow and eventually hangs.
>
> I get a message "hrtimer: interrupt too slow", and I get a soft lockup bug. The rest
> of the message log seems pretty garbled.
>
> In that case, I should probably defer the perf_counter_output() and simply switch
> buffers in the interrupt handler. This would use twice as much locked memory, though, and
> it will likely lose trace when tracing kernel branches. I would further need to make
> sure that the counter does not go away when I do the perf_counter_output(). If possible,
> I should also stall the task until its trace has been processed.
>
> All in all, it adds complexity and makes the feature more expensive. If you think that
> this could cause the problem of the hanging kernel, I would give it a try.
>
>
> One more thing, Peter's patch seems to make the problem appear much more reliably
> than before. Without the patch, I only got the kernel hang when I ran perf top
> in the background. Now, the kernel hangs for every perf record that uses branch
> tracing. This could give another hint to the problem, but I did not find anything
> when I looked at the patch. Do you have any idea, Peter?

Not much, I don't appear to have a single system with serial output (or
another reliable console) that has BTS hardware.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/