Re: [PATCH,RFC] perf: panic due to inclied cpu context task_ctxvalue

From: Peter Zijlstra
Date: Mon Mar 28 2011 - 11:49:58 EST


On Mon, 2011-03-28 at 16:57 +0200, Peter Zijlstra wrote:
> >
> > Wait... Yes, we have to clear ctx->is_active, otherwise we break, say,
> > perf_install_in_context().
> >
> > But if we clear ->is_active we break perf_event_enable(). Suppose we
> > are doing ioctl(PERF_EVENT_IOC_DISABLE) + ioctl(PERF_EVENT_IOC_ENABLE).
> > PERF_EVENT_IOC_DISABLE can sched_out the last event, but _IOC_ENABLE
> > treats ctx->is_active == F as "it is not running".
>
> Right, same for the tick, if say we can only schedule 1 event at a time
> and we close the 1 event that is active, the tick will not rotate a new
> event in.

Another fun race, suppose we do properly remove task_ctx and is_active,
but then the task gets scheduled back in before free_event() gets around
to disabling the jump_label..


--
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/