Messages in this thread | | | From | Alexander Shishkin <> | Subject | Re: [PATCH 2/7] perf: Generalize task_function_call()ers | Date | Mon, 21 Dec 2015 16:39:22 +0200 |
| |
Peter Zijlstra <peterz@infradead.org> writes:
> - > - /* > - * If the context we're installing events in is not the > - * active task_ctx, flip them. > - */ > - if (ctx->task && task_ctx != ctx) { > - if (task_ctx) > - raw_spin_unlock(&task_ctx->lock); > - raw_spin_lock(&ctx->lock); > - task_ctx = ctx; > - } > - > - if (task_ctx) { > - cpuctx->task_ctx = task_ctx; > - task = task_ctx->task; > - } > -
So previously, this would schedule in the tast_ctx right in perf_install_in_context path.
The new code would only reschedule the context if it is already on:
> + if (ctx->is_active) > + perf_resched_context(cpuctx); > }
which means, iiuc, that an enabled event (say, attr.disabled==0) will have to wait till the next time the ctx::task is scheduled instead of getting scheduled right here.
Something like
if (ctx->task == current && ctx->nr_events) perf_event_sched_in(cpuctx, ctx, ctx->task);
might make sense here.
Also the new __perf_event_enable() has the same symptom: it doesn't schedule the new context on, only reschedule it if it's already on.
Regards, -- Alex
| |