]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
sched/rt: Use container_of() to get root domain in rto_push_irq_work_func()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 24 Jan 2018 01:45:37 +0000 (20:45 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 3 Apr 2018 12:58:45 +0000 (14:58 +0200)
commit5252ef6fa67d8d63638de3a157e6d40040b88af7
tree07942390c106266fce68bd2f8cfb346ab258f83c
parent22008bf37a006a4536340d4293ed68b5cc17aaf8
sched/rt: Use container_of() to get root domain in rto_push_irq_work_func()

BugLink: http://bugs.launchpad.net/bugs/1756121
commit ad0f1d9d65938aec72a698116cd73a980916895e upstream.

When the rto_push_irq_work_func() is called, it looks at the RT overloaded
bitmask in the root domain via the runqueue (rq->rd). The problem is that
during CPU up and down, nothing here stops rq->rd from changing between
taking the rq->rd->rto_lock and releasing it. That means the lock that is
released is not the same lock that was taken.

Instead of using this_rq()->rd to get the root domain, as the irq work is
part of the root domain, we can simply get the root domain from the irq work
that is passed to the routine:

 container_of(work, struct root_domain, rto_push_work)

This keeps the root domain consistent.

Reported-by: Pavan Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.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>
Fixes: 4bdced5c9a292 ("sched/rt: Simplify the IPI based RT balancing logic")
Link: http://lkml.kernel.org/r/CAEU1=PkiHO35Dzna8EQqNSKW1fr1y1zRQ5y66X117MG06sQtNA@mail.gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Juerg Haefliger <juergh@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
kernel/sched/rt.c