lkml.org 
[lkml]   [2012]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [Question] sched: Should nr_uninterruptible be decremented in ttwu_do_activate()?
    From
    On Wed, Jan 11, 2012 at 11:29 PM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
    > On Wed, 2012-01-11 at 23:22 +0600, Rakib Mullick wrote:
    >> Hello all,
    >>
    >> In ttwu_do_activate(), we're decrementing nr_uninterruptible if
    >> p->sched_contributes_to_load (for SMP=y). But, we're also decrementing
    >> nr_uninterruptible from activate_task at the same path. Why we're
    >> doing it twice for a single task activation path?
    >
    > activate_task() does:
    >
    >  if (task_contributes_to_load(p))
    >   rq->nr_uninterruptible--;
    >
    > Now task_contributes_to_load() reads like:
    >
    > #define task_contributes_to_load(task)  \
    >                                ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
    >                                 (task->flags & PF_FREEZING) == 0)
    >
    > which will be false, since we've set TASK_WAKING.

    Enough confusing. TASK_WAKING will be set when called from
    try_to_wake_up(). ttwu_do_activate() gets called from other places:
    scheduler_ipi() and sched_ttwu_pending() (at the time of cpu goes
    down). TASK_WAKING will be not set at that time, moreover it is
    possible that, task has p->sched_contributes_to_load is set and latter
    on gets wake up by sched_ttwu_pending/scheduler_ipi() call.

    Thanks,
    Rakib
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-01-12 07:11    [W:0.024 / U:2.108 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site