sched/fair: Add tmp_alone_branch assertion
authorPeter Zijlstra <peterz@infradead.org>
Wed, 30 Jan 2019 13:41:04 +0000 (14:41 +0100)
committerIngo Molnar <mingo@kernel.org>
Mon, 4 Feb 2019 08:13:21 +0000 (09:13 +0100)
commit5d299eabea5a251fbf66e8277704b874bbba92dc
treedde557b31905049b265f4912deb0784ad691680b
parentc546951d9c9300065bad253ecdf1ac59ce9d06c8
sched/fair: Add tmp_alone_branch assertion

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: Peter 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: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c