diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-08-09 19:02:09 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-09-23 12:18:08 -0400 |
commit | bb311eccbdab974639263060b8452bf304af0b0c (patch) | |
tree | 0265d33c06302fba42157e2b231862fce7de6766 | |
parent | 63c4db78e80407976e47bccaa2a4d8251b5a10bc (diff) |
rcu: Add tracing of normal (non-NOCB) grace-period requests
This commit adds tracing to the normal grace-period request points.
These are rcu_gp_cleanup(), which checks for the need for another
grace period at the end of the previous grace period, and
rcu_start_gp_advanced(), which restarts RCU's state machine after
an idle period. These trace events are intended to help track down
bugs where RCU remains idle despite there being work for it to do.
Reported-by: Clark Williams <williams@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | include/trace/events/rcu.h | 1 | ||||
-rw-r--r-- | kernel/rcutree.c | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index 60077e12093c..98466c618ebc 100644 --- a/include/trace/events/rcu.h +++ b/include/trace/events/rcu.h | |||
@@ -45,6 +45,7 @@ TRACE_EVENT(rcu_utilization, | |||
45 | * | 45 | * |
46 | * "AccReadyCB": CPU acclerates new callbacks to RCU_NEXT_READY_TAIL. | 46 | * "AccReadyCB": CPU acclerates new callbacks to RCU_NEXT_READY_TAIL. |
47 | * "AccWaitCB": CPU accelerates new callbacks to RCU_WAIT_TAIL. | 47 | * "AccWaitCB": CPU accelerates new callbacks to RCU_WAIT_TAIL. |
48 | * "newreq": Request a new grace period. | ||
48 | * "start": Start a grace period. | 49 | * "start": Start a grace period. |
49 | * "cpustart": CPU first notices a grace-period start. | 50 | * "cpustart": CPU first notices a grace-period start. |
50 | * "cpuqs": CPU passes through a quiescent state. | 51 | * "cpuqs": CPU passes through a quiescent state. |
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 78d371526667..54dd6d03dbb5 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -1459,8 +1459,12 @@ static void rcu_gp_cleanup(struct rcu_state *rsp) | |||
1459 | rsp->fqs_state = RCU_GP_IDLE; | 1459 | rsp->fqs_state = RCU_GP_IDLE; |
1460 | rdp = this_cpu_ptr(rsp->rda); | 1460 | rdp = this_cpu_ptr(rsp->rda); |
1461 | rcu_advance_cbs(rsp, rnp, rdp); /* Reduce false positives below. */ | 1461 | rcu_advance_cbs(rsp, rnp, rdp); /* Reduce false positives below. */ |
1462 | if (cpu_needs_another_gp(rsp, rdp)) | 1462 | if (cpu_needs_another_gp(rsp, rdp)) { |
1463 | rsp->gp_flags = 1; | 1463 | rsp->gp_flags = 1; |
1464 | trace_rcu_grace_period(rsp->name, | ||
1465 | ACCESS_ONCE(rsp->gpnum), | ||
1466 | TPS("newreq")); | ||
1467 | } | ||
1464 | raw_spin_unlock_irq(&rnp->lock); | 1468 | raw_spin_unlock_irq(&rnp->lock); |
1465 | } | 1469 | } |
1466 | 1470 | ||
@@ -1584,6 +1588,8 @@ rcu_start_gp_advanced(struct rcu_state *rsp, struct rcu_node *rnp, | |||
1584 | return; | 1588 | return; |
1585 | } | 1589 | } |
1586 | rsp->gp_flags = RCU_GP_FLAG_INIT; | 1590 | rsp->gp_flags = RCU_GP_FLAG_INIT; |
1591 | trace_rcu_grace_period(rsp->name, ACCESS_ONCE(rsp->gpnum), | ||
1592 | TPS("newreq")); | ||
1587 | 1593 | ||
1588 | /* | 1594 | /* |
1589 | * We can't do wakeups while holding the rnp->lock, as that | 1595 | * We can't do wakeups while holding the rnp->lock, as that |