lkml.org 
[lkml]   [2015]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 2/7] perf: Generalize task_function_call()ers
    Date
    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


    \
     
     \ /
      Last update: 2015-12-21 16:01    [W:3.068 / U:1.524 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site