lkml.org 
[lkml]   [2011]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH -v8a 1/7] sched: check the right ->nr_running in yield_task_fair
    With CONFIG_FAIR_GROUP_SCHED, each task_group has its own cfs_rq.
    Yielding to a task from another cfs_rq may be worthwhile, since
    a process calling yield typically cannot use the CPU right now.

    Therefor, we want to check the per-cpu nr_running, not the
    cgroup local one.

    Signed-off-by: Rik van Riel <riel@redhat.com>
    ---
    kernel/sched_fair.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
    index c62ebae..7b338ac 100644
    --- a/kernel/sched_fair.c
    +++ b/kernel/sched_fair.c
    @@ -1304,7 +1304,7 @@ static void yield_task_fair(struct rq *rq)
    /*
    * Are we the only task in the tree?
    */
    - if (unlikely(cfs_rq->nr_running == 1))
    + if (unlikely(rq->nr_running == 1))
    return;

    clear_buddies(cfs_rq, se);

    \
     
     \ /
      Last update: 2011-02-01 15:57    [W:0.021 / U:61.176 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site