Re: [RFC][PATCH 12/12] perf: Collapse and fix event_function_call() users

From: Peter Zijlstra
Date: Wed Jan 13 2016 - 12:30:22 EST


On Wed, Jan 13, 2016 at 03:46:58PM +0200, Alexander Shishkin wrote:
> Peter Zijlstra <peterz@xxxxxxxxxxxxx> writes:
>
> > @@ -2250,7 +2269,11 @@ static void __perf_event_enable(struct p
> > if (leader != event && leader->state != PERF_EVENT_STATE_ACTIVE)
> > return;
> >
> > - ctx_resched(cpuctx, ctx);
> > + task_ctx = cpuctx->task_ctx;
> > + if (ctx->task)
> > + WARN_ON_ONCE(task_ctx != ctx);
> > +
> > + ctx_resched(cpuctx, task_ctx);
>
> Afaict, ctx_resched() path already does this in task_ctx_sched_out().

It does not; that got changed somewhere along the way :-)