• Peter Zijlstra's avatar
    sched/fair: Add tmp_alone_branch assertion · 6c11530e
    Peter Zijlstra authored
    commit 5d299eab upstream.
    
    The magic in list_add_leaf_cfs_rq() requires that at the end of
    enqueue_task_fair():
    
      rq->tmp_alone_branch == &rq->lead_cfs_rq_list
    
    If this is violated, list integrity is compromised for list entries
    and the tmp_alone_branch pointer might dangle.
    
    Also, reflow list_add_leaf_cfs_rq() while there. This looses one
    indentation level and generates a form that's convenient for the next
    patch.
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Cc: Janne Huttunen <janne.huttunen@nokia.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    6c11530e
fair.c 270 KB