[PATCH 4/4] jrcu: add new stat to /sys/kernel/debug/rcu/rcudata

From: Joe Korty
Date: Wed Mar 09 2011 - 17:17:48 EST


jrcu: display #passes in /sys/kernel/debug/rcu/rcudata.

Sometimes, when things are not working right, you cannot
tell if that is because the daemon is not running at all,
or because it is running, but on every pass it decides
to do no work. With this change those two states can
now be distinguished.

Signed-off-by: Joe Korty <joe.korty@xxxxxxxx>

Index: b/kernel/jrcu.c
===================================================================
--- a/kernel/jrcu.c
+++ b/kernel/jrcu.c
@@ -115,6 +115,7 @@ static struct rcu_data rcu_data[NR_CPUS]

/* debug & statistics stuff */
static struct rcu_stats {
+ unsigned npasses; /* #passes made */
unsigned nbatches; /* #end-of-batches (eobs) seen */
atomic_t nbarriers; /* #rcu barriers processed */
u64 ninvoked; /* #invoked (ie, finished) callbacks */
@@ -362,6 +363,7 @@ static void rcu_delimit_batches(void)
struct rcu_list pending;

rcu_list_init(&pending);
+ rcu_stats.npasses++;

raw_local_irq_save(flags);
smp_rmb();
@@ -529,6 +531,8 @@ static int rcu_debugfs_show(struct seq_f
msecs = div_s64(sched_clock() - rcu_timestamp, NSEC_PER_MSEC);
raw_local_irq_enable();

+ seq_printf(m, "%14u: #passes seen\n",
+ rcu_stats.npasses);
seq_printf(m, "%14u: #batches seen\n",
rcu_stats.nbatches);
seq_printf(m, "%14u: #barriers seen\n",
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/