From: Paul E. McKenney Date: Sat, 29 Dec 2012 22:52:41 +0000 (-0800) Subject: rcu: Rearrange locking in rcu_start_gp() X-Git-Tag: v3.10-rc1~175^2^2^3~5 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b92db6cb7efcbd41e469e1d757c47da4865f7622;p=~emulex%2Finfiniband.git rcu: Rearrange locking in rcu_start_gp() If CPUs are to give prior notice of needed grace periods, it will be necessary to invoke rcu_start_gp() without dropping the root rcu_node structure's ->lock. This commit takes a first step in this direction by moving the release of this lock to the end of rcu_start_gp(). Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney --- diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 7b1d7769872..2c6a9314c7f 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -1521,16 +1521,14 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags) raw_spin_unlock_irqrestore(&rnp->lock, flags); return; } - rsp->gp_flags = RCU_GP_FLAG_INIT; - raw_spin_unlock(&rnp->lock); /* Interrupts remain disabled. */ /* Ensure that CPU is aware of completion of last grace period. */ - rcu_process_gp_end(rsp, rdp); - local_irq_restore(flags); + __rcu_process_gp_end(rsp, rdp->mynode, rdp); /* Wake up rcu_gp_kthread() to start the grace period. */ wake_up(&rsp->gp_wq); + raw_spin_unlock_irqrestore(&rnp->lock, flags); } /*