]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 6 Mar 2020 07:13:20 +0000 (02:13 -0500)
commita653325a3cf6437052914f28dadea409f7524762
tree25144dd2e18c65992ffea7fe410e54265869ab6e
parent98ad9ec55ef9cbff0ab63075fb5c37a031fb31e2
sched/fair: Add tmp_alone_branch assertion

BugLink: https://bugs.launchpad.net/bugs/1864904
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
kernel/sched/fair.c