rcu: Add event-tracing for RCU callback invocation

There was recently some controversy about the overhead of invoking RCU
callbacks.  Add TRACE_EVENT()s to obtain fine-grained timings for the
start and stop of a batch of callbacks and also for each callback invoked.

Signed-off-by: Paul E. McKenney <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
This commit is contained in:
Paul E. McKenney 2011-06-17 15:53:19 -07:00 • committed by Paul E. McKenney
commit 29c00b4a1d
6 changed files with 219 additions and 54 deletions

View file

@ -37,6 +37,25 @@
#include <linux/cpu.h>
#include <linux/prefetch.h>
#ifdef CONFIG_RCU_TRACE
#include <trace/events/rcu.h>
#else /* #ifdef CONFIG_RCU_TRACE */
/* No by-default tracing in TINY_RCU: Keep TINY_RCU tiny! */
static void trace_rcu_invoke_kfree_callback(struct rcu_head *rhp,
unsigned long offset)
{
}
static void trace_rcu_invoke_callback(struct rcu_head *head)
{
}
#endif /* #else #ifdef CONFIG_RCU_TRACE */
#include "rcu.h"
/* Controls for rcu_kthread() kthread, replacing RCU_SOFTIRQ used previously. */
static struct task_struct *rcu_kthread_task;
static DECLARE_WAIT_QUEUE_HEAD(rcu_kthread_wq);
@ -161,11 +180,15 @@ static void rcu_process_callbacks(struct rcu_ctrlblk *rcp)
RCU_TRACE(int cb_count = 0);
/* If no RCU callbacks ready to invoke, just return. */
if (&rcp->rcucblist == rcp->donetail)
if (&rcp->rcucblist == rcp->donetail) {
RCU_TRACE(trace_rcu_batch_start(0, -1));
RCU_TRACE(trace_rcu_batch_end(0));
return;
}
/* Move the ready-to-invoke callbacks to a local list. */
local_irq_save(flags);
RCU_TRACE(trace_rcu_batch_start(0, -1));
list = rcp->rcucblist;
rcp->rcucblist = *rcp->donetail;
*rcp->donetail = NULL;
@ -187,6 +210,7 @@ static void rcu_process_callbacks(struct rcu_ctrlblk *rcp)
RCU_TRACE(cb_count++);
}
RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count));
RCU_TRACE(trace_rcu_batch_end(cb_count));
}
/*