rcu: Move wakeup out from under rnp->lock
authorPeter Zijlstra <peterz@infradead.org>
Wed, 4 Nov 2015 16:22:05 +0000 (08:22 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 8 Dec 2015 01:01:32 +0000 (17:01 -0800)
This patch removes a potential deadlock hazard by moving the
wake_up_process() in rcu_spawn_gp_kthread() out from under rnp->lock.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree.c

index 40940b0d03109c44c782fbccfd93b0079a7cea65..87b604d0b0d22d67ffe7cd6132d9b5e667e5f56b 100644 (file)
@@ -4319,8 +4319,8 @@ static int __init rcu_spawn_gp_kthread(void)
                        sp.sched_priority = kthread_prio;
                        sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
                }
-               wake_up_process(t);
                raw_spin_unlock_irqrestore(&rnp->lock, flags);
+               wake_up_process(t);
        }
        rcu_spawn_nocb_kthreads();
        rcu_spawn_boost_kthreads();