]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sched/fair: Add tmp_alone_branch assertion
authorPeter Zijlstra <peterz@infradead.org>
Wed, 30 Jan 2019 13:41:04 +0000 (14:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Feb 2020 09:37:10 +0000 (09:37 +0000)
commit6c11530ea420d144038694fd01a2d15b8e58cf11
tree3b81178fda008c76ef9d8408610c2d7ebd1778f3
parentf0a31232b38fd870236fe18f37e0efe1c80b2ac2
sched/fair: Add tmp_alone_branch assertion

commit 5d299eabea5a251fbf66e8277704b874bbba92dc 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: 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>
Cc: Janne Huttunen <janne.huttunen@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/sched/fair.c