From: Paul E. McKenney Date: Tue, 19 Mar 2013 17:53:14 +0000 (-0700) Subject: rcu: Make __note_new_gpnum() check for ends of prior grace periods X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=398ebe6000c16135d12ce2ff64318f306ffb20b0;p=linux-beck.git rcu: Make __note_new_gpnum() check for ends of prior grace periods The current implementation can detect the beginning of a new grace period before noting the end of a previous grace period. Although the current implementation correctly handles this sort of nonsense, it would be good to reduce RCU's state space by making such nonsense unnecessary, which is now possible thanks to the fact that RCU's callback groups are now numbered. This commit therefore makes __note_new_gpnum() invoke __rcu_process_gp_end() in order to note the ends of prior grace periods before noting the beginnings of new grace periods. Of course, this now means that note_new_gpnum() notes both the beginnings and ends of grace periods, and could therefore be used in place of rcu_process_gp_end(). But that is a job for later commits. Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett --- diff --git a/kernel/rcutree.c b/kernel/rcutree.c index c36e52dc091d..54aba759b609 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -1309,6 +1309,9 @@ __rcu_process_gp_end(struct rcu_state *rsp, struct rcu_node *rnp, struct rcu_dat */ static void __note_new_gpnum(struct rcu_state *rsp, struct rcu_node *rnp, struct rcu_data *rdp) { + /* Handle the ends of any preceding grace periods first. */ + __rcu_process_gp_end(rsp, rnp, rdp); + if (rdp->gpnum != rnp->gpnum) { /* * If the current grace period is waiting for this CPU,