diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2016-01-28 23:49:49 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2016-03-31 16:34:06 -0400 |
commit | 4f41530245c7fd4837152e264d120d05ae940eb0 (patch) | |
tree | 7edeb2bdcc01800917934f7a2c1a1011dbeafebb /kernel/rcu/tree.c | |
parent | bea2de44ae647698dc848a671fdee6e53c192423 (diff) |
rcu: Add expedited-grace-period event tracing
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r-- | kernel/rcu/tree.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 79e9206a7b11..524026fd9dd7 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -3584,17 +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 | trace_rcu_exp_grace_period(rsp->name, s, TPS("done")); | ||
3587 | if (rnp) { | 3588 | if (rnp) { |
3588 | mutex_unlock(&rnp->exp_funnel_mutex); | ||
3589 | trace_rcu_exp_funnel_lock(rsp->name, rnp->level, | 3589 | trace_rcu_exp_funnel_lock(rsp->name, rnp->level, |
3590 | rnp->grplo, rnp->grphi, | 3590 | rnp->grplo, rnp->grphi, |
3591 | TPS("rel")); | 3591 | TPS("rel")); |
3592 | mutex_unlock(&rnp->exp_funnel_mutex); | ||
3592 | } else if (rdp) { | 3593 | } else if (rdp) { |
3593 | mutex_unlock(&rdp->exp_funnel_mutex); | ||
3594 | trace_rcu_exp_funnel_lock(rsp->name, | 3594 | trace_rcu_exp_funnel_lock(rsp->name, |
3595 | rdp->mynode->level + 1, | 3595 | rdp->mynode->level + 1, |
3596 | rdp->cpu, rdp->cpu, | 3596 | rdp->cpu, rdp->cpu, |
3597 | TPS("rel")); | 3597 | TPS("rel")); |
3598 | mutex_unlock(&rdp->exp_funnel_mutex); | ||
3598 | } | 3599 | } |
3599 | /* Ensure test happens before caller kfree(). */ | 3600 | /* Ensure test happens before caller kfree(). */ |
3600 | smp_mb__before_atomic(); /* ^^^ */ | 3601 | smp_mb__before_atomic(); /* ^^^ */ |
@@ -3624,12 +3625,12 @@ static struct rcu_node *exp_funnel_lock(struct rcu_state *rsp, unsigned long s) | |||
3624 | rnp0 = rcu_get_root(rsp); | 3625 | rnp0 = rcu_get_root(rsp); |
3625 | if (!mutex_is_locked(&rnp0->exp_funnel_mutex)) { | 3626 | if (!mutex_is_locked(&rnp0->exp_funnel_mutex)) { |
3626 | if (mutex_trylock(&rnp0->exp_funnel_mutex)) { | 3627 | if (mutex_trylock(&rnp0->exp_funnel_mutex)) { |
3627 | if (sync_exp_work_done(rsp, rnp0, NULL, | ||
3628 | &rdp->expedited_workdone0, s)) | ||
3629 | return NULL; | ||
3630 | trace_rcu_exp_funnel_lock(rsp->name, rnp0->level, | 3628 | trace_rcu_exp_funnel_lock(rsp->name, rnp0->level, |
3631 | rnp0->grplo, rnp0->grphi, | 3629 | rnp0->grplo, rnp0->grphi, |
3632 | TPS("acq")); | 3630 | TPS("acq")); |
3631 | if (sync_exp_work_done(rsp, rnp0, NULL, | ||
3632 | &rdp->expedited_workdone0, s)) | ||
3633 | return NULL; | ||
3633 | return rnp0; | 3634 | return rnp0; |
3634 | } | 3635 | } |
3635 | } | 3636 | } |
@@ -3656,16 +3657,16 @@ static struct rcu_node *exp_funnel_lock(struct rcu_state *rsp, unsigned long s) | |||
3656 | trace_rcu_exp_funnel_lock(rsp->name, rnp0->level, | 3657 | trace_rcu_exp_funnel_lock(rsp->name, rnp0->level, |
3657 | rnp0->grplo, rnp0->grphi, TPS("acq")); | 3658 | rnp0->grplo, rnp0->grphi, TPS("acq")); |
3658 | if (rnp1) { | 3659 | if (rnp1) { |
3659 | mutex_unlock(&rnp1->exp_funnel_mutex); | ||
3660 | trace_rcu_exp_funnel_lock(rsp->name, rnp1->level, | 3660 | trace_rcu_exp_funnel_lock(rsp->name, rnp1->level, |
3661 | rnp1->grplo, rnp1->grphi, | 3661 | rnp1->grplo, rnp1->grphi, |
3662 | TPS("rel")); | 3662 | TPS("rel")); |
3663 | mutex_unlock(&rnp1->exp_funnel_mutex); | ||
3663 | } else { | 3664 | } else { |
3664 | mutex_unlock(&rdp->exp_funnel_mutex); | ||
3665 | trace_rcu_exp_funnel_lock(rsp->name, | 3665 | trace_rcu_exp_funnel_lock(rsp->name, |
3666 | rdp->mynode->level + 1, | 3666 | rdp->mynode->level + 1, |
3667 | rdp->cpu, rdp->cpu, | 3667 | rdp->cpu, rdp->cpu, |
3668 | TPS("rel")); | 3668 | TPS("rel")); |
3669 | mutex_unlock(&rdp->exp_funnel_mutex); | ||
3669 | } | 3670 | } |
3670 | rnp1 = rnp0; | 3671 | rnp1 = rnp0; |
3671 | } | 3672 | } |
@@ -3895,16 +3896,21 @@ void synchronize_sched_expedited(void) | |||
3895 | 3896 | ||
3896 | /* Take a snapshot of the sequence number. */ | 3897 | /* Take a snapshot of the sequence number. */ |
3897 | s = rcu_exp_gp_seq_snap(rsp); | 3898 | s = rcu_exp_gp_seq_snap(rsp); |
3899 | trace_rcu_exp_grace_period(rsp->name, s, TPS("snap")); | ||
3898 | 3900 | ||
3899 | rnp = exp_funnel_lock(rsp, s); | 3901 | rnp = exp_funnel_lock(rsp, s); |
3900 | if (rnp == NULL) | 3902 | if (rnp == NULL) |
3901 | return; /* Someone else did our work for us. */ | 3903 | return; /* Someone else did our work for us. */ |
3902 | 3904 | ||
3903 | rcu_exp_gp_seq_start(rsp); | 3905 | rcu_exp_gp_seq_start(rsp); |
3906 | trace_rcu_exp_grace_period(rsp->name, s, TPS("start")); | ||
3904 | sync_rcu_exp_select_cpus(rsp, sync_sched_exp_handler); | 3907 | sync_rcu_exp_select_cpus(rsp, sync_sched_exp_handler); |
3905 | synchronize_sched_expedited_wait(rsp); | 3908 | synchronize_sched_expedited_wait(rsp); |
3906 | 3909 | ||
3907 | rcu_exp_gp_seq_end(rsp); | 3910 | rcu_exp_gp_seq_end(rsp); |
3911 | trace_rcu_exp_grace_period(rsp->name, s, TPS("end")); | ||
3912 | trace_rcu_exp_funnel_lock(rsp->name, rnp->level, | ||
3913 | rnp->grplo, rnp->grphi, TPS("rel")); | ||
3908 | mutex_unlock(&rnp->exp_funnel_mutex); | 3914 | mutex_unlock(&rnp->exp_funnel_mutex); |
3909 | } | 3915 | } |
3910 | EXPORT_SYMBOL_GPL(synchronize_sched_expedited); | 3916 | EXPORT_SYMBOL_GPL(synchronize_sched_expedited); |