lkml.org 
[lkml]   [2009]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[tip:sched/core] sched: Fix TASK_WAKING & loadaverage breakage
    Commit-ID:  035e5274f713b8c00afa86abd9b5d70317ae9305
    Gitweb: http://git.kernel.org/tip/035e5274f713b8c00afa86abd9b5d70317ae9305
    Author: Ingo Molnar <mingo@elte.hu>
    AuthorDate: Wed, 16 Sep 2009 21:09:13 +0200
    Committer: Ingo Molnar <mingo@elte.hu>
    CommitDate: Wed, 16 Sep 2009 21:12:31 +0200

    sched: Fix TASK_WAKING & loadaverage breakage

    Fix this:

    top - 21:54:00 up 2:59, 1 user, load average: 432512.33, 426421.74, 417432.74

    Which happens because we now set TASK_WAKING before activate_task().

    Spread out activate_task() in two parts - this is also
    a micro-optimization as try_to_wake_up() is one of the
    hottest path.

    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>


    ---
    kernel/sched.c | 8 +++++++-
    1 files changed, 7 insertions(+), 1 deletions(-)

    diff --git a/kernel/sched.c b/kernel/sched.c
    index 5049d95..63a4995 100644
    --- a/kernel/sched.c
    +++ b/kernel/sched.c
    @@ -2343,7 +2343,11 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
    /*
    * In order to handle concurrent wakeups and release the rq->lock
    * we put the task in TASK_WAKING state.
    + *
    + * First fix up the nr_uninterruptible count:
    */
    + if (task_contributes_to_load(p))
    + rq->nr_uninterruptible--;
    p->state = TASK_WAKING;
    task_rq_unlock(rq, &flags);

    @@ -2381,7 +2385,9 @@ out_activate:
    schedstat_inc(p, se.nr_wakeups_local);
    else
    schedstat_inc(p, se.nr_wakeups_remote);
    - activate_task(rq, p, 1);
    +
    + enqueue_task(rq, p, 1);
    + inc_nr_running(rq);
    success = 1;

    /*

    \
     
     \ /
      Last update: 2009-09-16 21:19    [W:0.025 / U:33.192 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site