lkml.org 
[lkml]   [2010]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[RFC][PATCH 10/10] sched: Remove unlikely() from ttwu_post_activation
    From: Steven Rostedt <srostedt@redhat.com>

    The unlikely() used in ttwu_post_activation() tests if the rq->idle_stamp
    is set. But since this is for a wakeup, and wakeups happen when tasks
    block on IO, and blocking tasks on IO may put the system into idle,
    this can actually be a common occurence.

    Running the annotated branch profiler on an average desktop running
    firefox, evolution, xchat and distcc, the report shows:

    correct incorrect % Function File Line
    ------- --------- - -------- ---- ----
    34884862 146110926 80 ttwu_post_activation sched.c 2309

    80% of the time, this unlikely is incorrect. Best not to assume what the
    result is, and just remove the branch annotation.

    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    ---
    kernel/sched.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/kernel/sched.c b/kernel/sched.c
    index 269a045..6d24b2e 100644
    --- a/kernel/sched.c
    +++ b/kernel/sched.c
    @@ -2458,7 +2458,7 @@ static inline void ttwu_post_activation(struct task_struct *p, struct rq *rq,
    if (p->sched_class->task_woken)
    p->sched_class->task_woken(rq, p);

    - if (unlikely(rq->idle_stamp)) {
    + if (rq->idle_stamp) {
    u64 delta = rq->clock - rq->idle_stamp;
    u64 max = 2*sysctl_sched_migration_cost;

    --
    1.7.2.3



    \
     
     \ /
      Last update: 2010-12-07 03:17    [W:0.021 / U:29.348 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site