lkml.org 
[lkml]   [2009]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 6/6] sched: Add a lock break for PREEMPT=y
    Since load-balancing can hold rq->locks for quite a long while, allow
    breaking out early when there is lock contention.

    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    ---
    kernel/sched_fair.c | 4 ++++
    1 file changed, 4 insertions(+)

    Index: linux-2.6/kernel/sched_fair.c
    ===================================================================
    --- linux-2.6.orig/kernel/sched_fair.c
    +++ linux-2.6/kernel/sched_fair.c
    @@ -2065,6 +2065,10 @@ static int move_tasks(struct rq *this_rq
    */
    if (idle == CPU_NEWLY_IDLE && this_rq->nr_running)
    break;
    +
    + if (raw_spin_is_contended(&this_rq->lock) ||
    + raw_spin_is_contended(&busiest->lock))
    + break;
    #endif
    } while (load_moved && max_load_move > total_load_moved);

    --



    \
     
     \ /
      Last update: 2009-12-17 20:01    [W:0.076 / U:59.088 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site