diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-07-11 08:23:18 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-09-23 10:41:55 -0400 |
commit | 25d30cf4250f74e5ceb35f8f39739782408db633 (patch) | |
tree | 0dd1ff6527fbdd42fd023d68f9a07fb0856d0de0 /kernel/rcutree.c | |
parent | 661a85dc0d2ec0404e3b80909e413a9d5e42a239 (diff) |
rcu: Adjust for unconditional ->completed assignment
Now that the rcu_node structures' ->completed fields are unconditionally
assigned at grace-period cleanup time, they should already have the
correct value for the new grace period at grace-period initialization
time. This commit therefore inserts a WARN_ON_ONCE() to verify this
invariant.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r-- | kernel/rcutree.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index f0f3a18c0a20..a2eadd04fb29 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -1080,6 +1080,7 @@ static int rcu_gp_init(struct rcu_state *rsp) | |||
1080 | rcu_preempt_check_blocked_tasks(rnp); | 1080 | rcu_preempt_check_blocked_tasks(rnp); |
1081 | rnp->qsmask = rnp->qsmaskinit; | 1081 | rnp->qsmask = rnp->qsmaskinit; |
1082 | rnp->gpnum = rsp->gpnum; | 1082 | rnp->gpnum = rsp->gpnum; |
1083 | WARN_ON_ONCE(rnp->completed != rsp->completed); | ||
1083 | rnp->completed = rsp->completed; | 1084 | rnp->completed = rsp->completed; |
1084 | if (rnp == rdp->mynode) | 1085 | if (rnp == rdp->mynode) |
1085 | rcu_start_gp_per_cpu(rsp, rnp, rdp); | 1086 | rcu_start_gp_per_cpu(rsp, rnp, rdp); |
@@ -2777,7 +2778,8 @@ static void __init rcu_init_one(struct rcu_state *rsp, | |||
2777 | raw_spin_lock_init(&rnp->fqslock); | 2778 | raw_spin_lock_init(&rnp->fqslock); |
2778 | lockdep_set_class_and_name(&rnp->fqslock, | 2779 | lockdep_set_class_and_name(&rnp->fqslock, |
2779 | &rcu_fqs_class[i], fqs[i]); | 2780 | &rcu_fqs_class[i], fqs[i]); |
2780 | rnp->gpnum = 0; | 2781 | rnp->gpnum = rsp->gpnum; |
2782 | rnp->completed = rsp->completed; | ||
2781 | rnp->qsmask = 0; | 2783 | rnp->qsmask = 0; |
2782 | rnp->qsmaskinit = 0; | 2784 | rnp->qsmaskinit = 0; |
2783 | rnp->grplo = j * cpustride; | 2785 | rnp->grplo = j * cpustride; |