aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-01-28 23:30:06 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-03-31 16:34:06 -0400
commitbea2de44ae647698dc848a671fdee6e53c192423 (patch)
treeafca2086f2942e48274e366bc3857d7e22b81642 /kernel/rcu/tree.c
parente087816db9423fdc49302d3cd7ec01e487477a71 (diff)
rcu: Add funnel-locking tracing for expedited grace periods
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 178575c01d09..79e9206a7b11 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3584,10 +3584,18 @@ static bool sync_exp_work_done(struct rcu_state *rsp, struct rcu_node *rnp,
3584 atomic_long_t *stat, unsigned long s) 3584 atomic_long_t *stat, unsigned long s)
3585{ 3585{
3586 if (rcu_exp_gp_seq_done(rsp, s)) { 3586 if (rcu_exp_gp_seq_done(rsp, s)) {
3587 if (rnp) 3587 if (rnp) {
3588 mutex_unlock(&rnp->exp_funnel_mutex); 3588 mutex_unlock(&rnp->exp_funnel_mutex);
3589 else if (rdp) 3589 trace_rcu_exp_funnel_lock(rsp->name, rnp->level,
3590 rnp->grplo, rnp->grphi,
3591 TPS("rel"));
3592 } else if (rdp) {
3590 mutex_unlock(&rdp->exp_funnel_mutex); 3593 mutex_unlock(&rdp->exp_funnel_mutex);
3594 trace_rcu_exp_funnel_lock(rsp->name,
3595 rdp->mynode->level + 1,
3596 rdp->cpu, rdp->cpu,
3597 TPS("rel"));
3598 }
3591 /* Ensure test happens before caller kfree(). */ 3599 /* Ensure test happens before caller kfree(). */
3592 smp_mb__before_atomic(); /* ^^^ */ 3600 smp_mb__before_atomic(); /* ^^^ */
3593 atomic_long_inc(stat); 3601 atomic_long_inc(stat);
@@ -3619,6 +3627,9 @@ static struct rcu_node *exp_funnel_lock(struct rcu_state *rsp, unsigned long s)
3619 if (sync_exp_work_done(rsp, rnp0, NULL, 3627 if (sync_exp_work_done(rsp, rnp0, NULL,
3620 &rdp->expedited_workdone0, s)) 3628 &rdp->expedited_workdone0, s))
3621 return NULL; 3629 return NULL;
3630 trace_rcu_exp_funnel_lock(rsp->name, rnp0->level,
3631 rnp0->grplo, rnp0->grphi,
3632 TPS("acq"));
3622 return rnp0; 3633 return rnp0;
3623 } 3634 }
3624 } 3635 }
@@ -3634,16 +3645,28 @@ static struct rcu_node *exp_funnel_lock(struct rcu_state *rsp, unsigned long s)
3634 if (sync_exp_work_done(rsp, NULL, NULL, &rdp->expedited_workdone1, s)) 3645 if (sync_exp_work_done(rsp, NULL, NULL, &rdp->expedited_workdone1, s))
3635 return NULL; 3646 return NULL;
3636 mutex_lock(&rdp->exp_funnel_mutex); 3647 mutex_lock(&rdp->exp_funnel_mutex);
3648 trace_rcu_exp_funnel_lock(rsp->name, rdp->mynode->level + 1,
3649 rdp->cpu, rdp->cpu, TPS("acq"));
3637 rnp0 = rdp->mynode; 3650 rnp0 = rdp->mynode;
3638 for (; rnp0 != NULL; rnp0 = rnp0->parent) { 3651 for (; rnp0 != NULL; rnp0 = rnp0->parent) {
3639 if (sync_exp_work_done(rsp, rnp1, rdp, 3652 if (sync_exp_work_done(rsp, rnp1, rdp,
3640 &rdp->expedited_workdone2, s)) 3653 &rdp->expedited_workdone2, s))
3641 return NULL; 3654 return NULL;
3642 mutex_lock(&rnp0->exp_funnel_mutex); 3655 mutex_lock(&rnp0->exp_funnel_mutex);
3643 if (rnp1) 3656 trace_rcu_exp_funnel_lock(rsp->name, rnp0->level,
3657 rnp0->grplo, rnp0->grphi, TPS("acq"));
3658 if (rnp1) {
3644 mutex_unlock(&rnp1->exp_funnel_mutex); 3659 mutex_unlock(&rnp1->exp_funnel_mutex);
3645 else 3660 trace_rcu_exp_funnel_lock(rsp->name, rnp1->level,
3661 rnp1->grplo, rnp1->grphi,
3662 TPS("rel"));
3663 } else {
3646 mutex_unlock(&rdp->exp_funnel_mutex); 3664 mutex_unlock(&rdp->exp_funnel_mutex);
3665 trace_rcu_exp_funnel_lock(rsp->name,
3666 rdp->mynode->level + 1,
3667 rdp->cpu, rdp->cpu,
3668 TPS("rel"));
3669 }
3647 rnp1 = rnp0; 3670 rnp1 = rnp0;
3648 } 3671 }
3649 if (sync_exp_work_done(rsp, rnp1, rdp, 3672 if (sync_exp_work_done(rsp, rnp1, rdp,