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

From: Alexander Shishkin
Date: Wed Jan 13 2016 - 08:49:20 EST


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().

Regards,
--
Alex