Re: WARNING: at arch/x86/kernel/cpu/perf_event.c:989

From: Stephane Eranian
Date: Mon Feb 06 2012 - 09:32:45 EST


On Mon, Feb 6, 2012 at 3:29 PM, Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:
> On Mon, 2012-02-06 at 15:13 +0100, Stephane Eranian wrote:
>> Ok, I found the problem!
>>
>> it comes from perf_adjust_freq_unthr_context() vs perf_adjust_period().
>> The latter can under certain condition stop and restart the event. So we
>> had:
>>
>> Â Â Â stop()
>> Â Â Â if (delta > 0) {
>> Â Â Â Â Â Âperf_adjust_period() {
>> Â Â Â Â Â Â Â Âif (period > 8*...) {
>> Â Â Â Â Â Â Â Â Â Âstop()
>> Â Â Â Â Â Â Â Â Â Â...
>> Â Â Â Â Â Â Â Â Â Âstart()
>> Â Â Â Â Â Â Â Â}
>> Â Â Â Â Â Â}
>> Â Â Â Â}
>> Â Â Â Âstart()
>>
>> Could have a double stop() and double start(), thus triggering the warning in
>> x86_pmu_start().
>>
>> Will post a patch shortly to fix this.
>
> Nice, thanks for looking at this!
>
I am wondering why we stop and restart the code in perf_adjust_period()
when it's called from __perf_event_overflow(). Isn't it supposed to be stopped
already by the model specific interrupt handler. Looks like we do stop/start,
just to get the reload aspect of start. Is that right?
--
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/