lkml.org 
[lkml]   [2011]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[patch 3/7] sched: set skip_clock_update in yield_task_fair()
    From
    Date

    This is another case where we are on our way to schedule(),
    so can save a useless clock update and resulting microscopic
    vruntime update.

    Signed-off-by: Mike Galbraith <efault@gmx.de>

    ---
    kernel/sched/core.c | 8 +++++++-
    kernel/sched/fair.c | 6 ++++++
    2 files changed, 13 insertions(+), 1 deletion(-)

    Index: linux-3.0-tip/kernel/sched/core.c
    ===================================================================
    --- linux-3.0-tip.orig/kernel/sched/core.c
    +++ linux-3.0-tip/kernel/sched/core.c
    @@ -4547,7 +4547,13 @@ again:
    */
    if (preempt && rq != p_rq)
    resched_task(p_rq->curr);
    - }
    + } else
    + /*
    + * We might have set it in task_yield_fair(), but are
    + * not going to schedule(), so don't want to skip
    + * the next update.
    + */
    + rq->skip_clock_update = 0;

    out:
    double_rq_unlock(rq, p_rq);
    Index: linux-3.0-tip/kernel/sched/fair.c
    ===================================================================
    --- linux-3.0-tip.orig/kernel/sched/fair.c
    +++ linux-3.0-tip/kernel/sched/fair.c
    @@ -3062,6 +3062,12 @@ static void yield_task_fair(struct rq *r
    * Update run-time statistics of the 'current'.
    */
    update_curr(cfs_rq);
    + /*
    + * Tell update_rq_clock() that we've just updated,
    + * so we don't do microscopic update in schedule()
    + * and double the fastpath cost.
    + */
    + rq->skip_clock_update = 1;
    }

    set_skip_buddy(se);



    \
     
     \ /
      Last update: 2011-11-22 15:31    [W:0.024 / U:0.528 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site