All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH tip/core/rcu 0/14] Tracing changes for 3.8
@ 2012-10-30 17:04 Paul E. McKenney
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
  0 siblings, 1 reply; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches

Hello!

This patch series splits RCU's debugfs tracing files into per-RCU-flavor
directories and allows seeking to CPUs.  The patches in this series are
as follows:

1.	Create per-RCU-flavor debugfs directories.  (Courtesy of
	Michael Wang.)
2.	Add functions used by later patches to allow seeking to a given
	CPU.  (Courtesy of Michael Wang.)
3-5.	Convert rcudata, rcudata.csv, and rcu_pending to the new debugfs
	format.  (Courtesy of Michael Wang.)
6.	Replace the old interface with the new one.  (Courtesy of
	Michael Wang.)
7.	Remove the unused rcudata.csv interface.  (Courtesy of Michael Wang.)
8.	Fix formatting of grace-period numbers in rcugp debugfs output.
9-12.	Split rcubarrier, rcuboost, rcugp, and rcuhier by RCU flavor.
	(Courtesy of Michael Wang.)
13.	Remove old debugfs interfaces and stop printing RCU flavor in
	output given that it is implied by the directory name.
	(Courtesy of Michael Wang.)
14.	Add debugfs tracing for synchronize_sched_expedited().

							Thanx, Paul

 b/kernel/rcutree.c       |    4 
 b/kernel/rcutree_trace.c |    8 
 kernel/rcutree_trace.c   |  698 ++++++++++++++++++++++-------------------------
 3 files changed, 351 insertions(+), 359 deletions(-)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu
  2012-10-30 17:04 [PATCH tip/core/rcu 0/14] Tracing changes for 3.8 Paul E. McKenney
@ 2012-10-30 17:05 ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 02/14] rcu: Fundamental facility for 'CPU units sequence reading' Paul E. McKenney
                     ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch will create subdirectory according to each flavor of rcu, the new
structure will be:

	/debugfs/rcu/ -> rsp_0
		      -> rsp_1
		      -> ...

So we can go to '/debugfs/rcu/rsp_0' and get the cpu info of rsp_0 there.
The flavors of RCU are currently rcu_bh, rcu_preempt, and rcu_sched.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 693513b..62223a2 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -446,12 +446,20 @@ static struct dentry *rcudir;
 
 static int __init rcutree_trace_init(void)
 {
+	struct rcu_state *rsp;
 	struct dentry *retval;
+	struct dentry *rspdir;
 
 	rcudir = debugfs_create_dir("rcu", NULL);
 	if (!rcudir)
 		goto free_out;
 
+	for_each_rcu_flavor(rsp) {
+		rspdir = debugfs_create_dir(rsp->name, rcudir);
+		if (!rspdir)
+			goto free_out;
+	}
+
 	retval = debugfs_create_file("rcubarrier", 0444, rcudir,
 						NULL, &rcubarrier_fops);
 	if (!retval)
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 02/14] rcu: Fundamental facility for 'CPU units sequence reading'
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 03/14] rcu: Optimize the 'rcudata' for RCU trace Paul E. McKenney
                     ` (11 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch add the fundamental facility used by the following patches, so we
can implement the 'CPU units sequence reading' later.

This helps us avoid losing data when there are too many CPUs and too
small of a buffer, since this new approach allows userspace to read out
the data one CPU at a time.  Thus, if the buffer is not large enough,
userspace will get whatever CPUs fit, and can then issue another read
for the remainder of the data.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 62223a2..0dfe9b5 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -46,6 +46,36 @@
 #define RCU_TREE_NONCORE
 #include "rcutree.h"
 
+static int r_open(struct inode *inode, struct file *file,
+					const struct seq_operations *op)
+{
+	int ret = seq_open(file, op);
+	if (!ret) {
+		struct seq_file *m = (struct seq_file *)file->private_data;
+		m->private = inode->i_private;
+	}
+	return ret;
+}
+
+static void *r_start(struct seq_file *m, loff_t *pos)
+{
+	struct rcu_state *rsp = (struct rcu_state *)m->private;
+	*pos = cpumask_next(*pos - 1, cpu_possible_mask);
+	if ((*pos) < nr_cpu_ids)
+		return per_cpu_ptr(rsp->rda, *pos);
+	return NULL;
+}
+
+static void *r_next(struct seq_file *m, void *v, loff_t *pos)
+{
+	(*pos)++;
+	return r_start(m, pos);
+}
+
+static void r_stop(struct seq_file *m, void *v)
+{
+}
+
 static int show_rcubarrier(struct seq_file *m, void *unused)
 {
 	struct rcu_state *rsp;
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 03/14] rcu: Optimize the 'rcudata' for RCU trace
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 02/14] rcu: Fundamental facility for 'CPU units sequence reading' Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 04/14] rcu: Optimize the 'rcudata.csv' " Paul E. McKenney
                     ` (10 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch implements the new 'rcudata' interface under each rsp
directory, by using the 'CPU units sequence reading', thus avoiding loss
of tracing data.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 0dfe9b5..a11522f 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -174,6 +174,32 @@ static const struct file_operations rcudata_fops = {
 	.release = single_release,
 };
 
+static int new_show_rcudata(struct seq_file *m, void *v)
+{
+	print_one_rcu_data(m, (struct rcu_data *)v);
+	return 0;
+}
+
+static const struct seq_operations new_rcudate_op = {
+	.start = r_start,
+	.next  = r_next,
+	.stop  = r_stop,
+	.show  = new_show_rcudata,
+};
+
+static int new_rcudata_open(struct inode *inode, struct file *file)
+{
+	return r_open(inode, file, &new_rcudate_op);
+}
+
+static const struct file_operations new_rcudata_fops = {
+	.owner = THIS_MODULE,
+	.open = new_rcudata_open,
+	.read = seq_read,
+	.llseek = no_llseek,
+	.release = seq_release,
+};
+
 static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp)
 {
 	if (!rdp->beenonline)
@@ -488,6 +514,11 @@ static int __init rcutree_trace_init(void)
 		rspdir = debugfs_create_dir(rsp->name, rcudir);
 		if (!rspdir)
 			goto free_out;
+
+			retval = debugfs_create_file("rcudata", 0444,
+					rspdir, rsp, &new_rcudata_fops);
+			if (!retval)
+				goto free_out;
 	}
 
 	retval = debugfs_create_file("rcubarrier", 0444, rcudir,
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 04/14] rcu: Optimize the 'rcudata.csv' for RCU trace
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 02/14] rcu: Fundamental facility for 'CPU units sequence reading' Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 03/14] rcu: Optimize the 'rcudata' for RCU trace Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 05/14] rcu: Optimize the 'rcu_pending' " Paul E. McKenney
                     ` (9 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch implements the new 'rcudata.csv' interface under each rsp
directory, by using the 'CPU units sequence reading', thus avoiding loss
of tracing data.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index a11522f..e387a64 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -267,6 +267,43 @@ static const struct file_operations rcudata_csv_fops = {
 	.release = single_release,
 };
 
+static int new_show_rcudata_csv(struct seq_file *m, void *v)
+{
+	struct rcu_data *rdp = (struct rcu_data *)v;
+	if (cpumask_first(cpu_possible_mask) == rdp->cpu) {
+		seq_puts(m, "\"CPU\",\"Online?\",\"c\",\"g\",\"pq\",\"pq\",");
+		seq_puts(m, "\"dt\",\"dt nesting\",\"dt NMI nesting\",\"df\",");
+		seq_puts(m, "\"of\",\"qll\",\"ql\",\"qs\"");
+#ifdef CONFIG_RCU_BOOST
+		seq_puts(m, "\"kt\",\"ktl\"");
+#endif /* #ifdef CONFIG_RCU_BOOST */
+		seq_puts(m, ",\"b\",\"ci\",\"co\",\"ca\"\n");
+	}
+
+	print_one_rcu_data_csv(m, rdp);
+	return 0;
+}
+
+static const struct seq_operations new_rcudate_csv_op = {
+	.start = r_start,
+	.next  = r_next,
+	.stop  = r_stop,
+	.show  = new_show_rcudata_csv,
+};
+
+static int new_rcudata_csv_open(struct inode *inode, struct file *file)
+{
+	return r_open(inode, file, &new_rcudate_csv_op);
+}
+
+static const struct file_operations new_rcudata_csv_fops = {
+	.owner = THIS_MODULE,
+	.open = new_rcudata_csv_open,
+	.read = seq_read,
+	.llseek = no_llseek,
+	.release = seq_release,
+};
+
 #ifdef CONFIG_RCU_BOOST
 
 static void print_one_rcu_node_boost(struct seq_file *m, struct rcu_node *rnp)
@@ -519,6 +556,11 @@ static int __init rcutree_trace_init(void)
 					rspdir, rsp, &new_rcudata_fops);
 			if (!retval)
 				goto free_out;
+
+			retval = debugfs_create_file("rcudata.csv", 0444,
+					rspdir, rsp, &new_rcudata_csv_fops);
+			if (!retval)
+				goto free_out;
 	}
 
 	retval = debugfs_create_file("rcubarrier", 0444, rcudir,
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 05/14] rcu: Optimize the 'rcu_pending' for RCU trace
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
                     ` (2 preceding siblings ...)
  2012-10-30 17:05   ` [PATCH tip/core/rcu 04/14] rcu: Optimize the 'rcudata.csv' " Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 06/14] rcu: Replace the old interface with the new one Paul E. McKenney
                     ` (8 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch implements the new 'rcu_pending' interface under each rsp
directory, by using the 'CPU units sequence reading', thus avoiding loss
of tracing data.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |   41 +++++++++++++++++++++++++++++++++++------
 1 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index e387a64..8b24867 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -467,6 +467,8 @@ static const struct file_operations rcugp_fops = {
 
 static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp)
 {
+	if (!rdp->beenonline)
+		return;
 	seq_printf(m, "%3d%cnp=%ld ",
 		   rdp->cpu,
 		   cpu_is_offline(rdp->cpu) ? '!' : ' ',
@@ -485,16 +487,12 @@ static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp)
 static int show_rcu_pending(struct seq_file *m, void *unused)
 {
 	int cpu;
-	struct rcu_data *rdp;
 	struct rcu_state *rsp;
 
 	for_each_rcu_flavor(rsp) {
 		seq_printf(m, "%s:\n", rsp->name);
-		for_each_possible_cpu(cpu) {
-			rdp = per_cpu_ptr(rsp->rda, cpu);
-			if (rdp->beenonline)
-				print_one_rcu_pending(m, rdp);
-		}
+		for_each_possible_cpu(cpu)
+			print_one_rcu_pending(m, per_cpu_ptr(rsp->rda, cpu));
 	}
 	return 0;
 }
@@ -512,6 +510,32 @@ static const struct file_operations rcu_pending_fops = {
 	.release = single_release,
 };
 
+static int new_show_rcu_pending(struct seq_file *m, void *v)
+{
+	print_one_rcu_pending(m, (struct rcu_data *)v);
+	return 0;
+}
+
+static const struct seq_operations new_rcu_pending_op = {
+	.start = r_start,
+	.next  = r_next,
+	.stop  = r_stop,
+	.show  = new_show_rcu_pending,
+};
+
+static int new_rcu_pending_open(struct inode *inode, struct file *file)
+{
+	return r_open(inode, file, &new_rcu_pending_op);
+}
+
+static const struct file_operations new_rcu_pending_fops = {
+	.owner = THIS_MODULE,
+	.open = new_rcu_pending_open,
+	.read = seq_read,
+	.llseek = no_llseek,
+	.release = seq_release,
+};
+
 static int show_rcutorture(struct seq_file *m, void *unused)
 {
 	seq_printf(m, "rcutorture test sequence: %lu %s\n",
@@ -561,6 +585,11 @@ static int __init rcutree_trace_init(void)
 					rspdir, rsp, &new_rcudata_csv_fops);
 			if (!retval)
 				goto free_out;
+
+			retval = debugfs_create_file("rcu_pending", 0444,
+					rspdir, rsp, &new_rcu_pending_fops);
+			if (!retval)
+				goto free_out;
 	}
 
 	retval = debugfs_create_file("rcubarrier", 0444, rcudir,
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 06/14] rcu: Replace the old interface with the new one
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
                     ` (3 preceding siblings ...)
  2012-10-30 17:05   ` [PATCH tip/core/rcu 05/14] rcu: Optimize the 'rcu_pending' " Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 07/14] rcu: Remove the interface "rcudata.csv" Paul E. McKenney
                     ` (7 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch removed the old RCU debugfs interface and replaced it with
the new one.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |  148 ++++++++----------------------------------------
 1 files changed, 24 insertions(+), 124 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 8b24867..0e2ab64 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -148,53 +148,27 @@ static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp)
 		   rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted);
 }
 
-static int show_rcudata(struct seq_file *m, void *unused)
-{
-	int cpu;
-	struct rcu_state *rsp;
-
-	for_each_rcu_flavor(rsp) {
-		seq_printf(m, "%s:\n", rsp->name);
-		for_each_possible_cpu(cpu)
-			print_one_rcu_data(m, per_cpu_ptr(rsp->rda, cpu));
-	}
-	return 0;
-}
-
-static int rcudata_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, show_rcudata, NULL);
-}
-
-static const struct file_operations rcudata_fops = {
-	.owner = THIS_MODULE,
-	.open = rcudata_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-static int new_show_rcudata(struct seq_file *m, void *v)
+static int show_rcudata(struct seq_file *m, void *v)
 {
 	print_one_rcu_data(m, (struct rcu_data *)v);
 	return 0;
 }
 
-static const struct seq_operations new_rcudate_op = {
+static const struct seq_operations rcudate_op = {
 	.start = r_start,
 	.next  = r_next,
 	.stop  = r_stop,
-	.show  = new_show_rcudata,
+	.show  = show_rcudata,
 };
 
-static int new_rcudata_open(struct inode *inode, struct file *file)
+static int rcudata_open(struct inode *inode, struct file *file)
 {
-	return r_open(inode, file, &new_rcudate_op);
+	return r_open(inode, file, &rcudate_op);
 }
 
-static const struct file_operations new_rcudata_fops = {
+static const struct file_operations rcudata_fops = {
 	.owner = THIS_MODULE,
-	.open = new_rcudata_open,
+	.open = rcudata_open,
 	.read = seq_read,
 	.llseek = no_llseek,
 	.release = seq_release,
@@ -234,40 +208,7 @@ static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp)
 		   rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted);
 }
 
-static int show_rcudata_csv(struct seq_file *m, void *unused)
-{
-	int cpu;
-	struct rcu_state *rsp;
-
-	seq_puts(m, "\"CPU\",\"Online?\",\"c\",\"g\",\"pq\",\"pq\",");
-	seq_puts(m, "\"dt\",\"dt nesting\",\"dt NMI nesting\",\"df\",");
-	seq_puts(m, "\"of\",\"qll\",\"ql\",\"qs\"");
-#ifdef CONFIG_RCU_BOOST
-	seq_puts(m, "\"kt\",\"ktl\"");
-#endif /* #ifdef CONFIG_RCU_BOOST */
-	seq_puts(m, ",\"b\",\"ci\",\"co\",\"ca\"\n");
-	for_each_rcu_flavor(rsp) {
-		seq_printf(m, "\"%s:\"\n", rsp->name);
-		for_each_possible_cpu(cpu)
-			print_one_rcu_data_csv(m, per_cpu_ptr(rsp->rda, cpu));
-	}
-	return 0;
-}
-
-static int rcudata_csv_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, show_rcudata_csv, NULL);
-}
-
-static const struct file_operations rcudata_csv_fops = {
-	.owner = THIS_MODULE,
-	.open = rcudata_csv_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-static int new_show_rcudata_csv(struct seq_file *m, void *v)
+static int show_rcudata_csv(struct seq_file *m, void *v)
 {
 	struct rcu_data *rdp = (struct rcu_data *)v;
 	if (cpumask_first(cpu_possible_mask) == rdp->cpu) {
@@ -284,21 +225,21 @@ static int new_show_rcudata_csv(struct seq_file *m, void *v)
 	return 0;
 }
 
-static const struct seq_operations new_rcudate_csv_op = {
+static const struct seq_operations rcudate_csv_op = {
 	.start = r_start,
 	.next  = r_next,
 	.stop  = r_stop,
-	.show  = new_show_rcudata_csv,
+	.show  = show_rcudata_csv,
 };
 
-static int new_rcudata_csv_open(struct inode *inode, struct file *file)
+static int rcudata_csv_open(struct inode *inode, struct file *file)
 {
-	return r_open(inode, file, &new_rcudate_csv_op);
+	return r_open(inode, file, &rcudate_csv_op);
 }
 
-static const struct file_operations new_rcudata_csv_fops = {
+static const struct file_operations rcudata_csv_fops = {
 	.owner = THIS_MODULE,
-	.open = new_rcudata_csv_open,
+	.open = rcudata_csv_open,
 	.read = seq_read,
 	.llseek = no_llseek,
 	.release = seq_release,
@@ -484,53 +425,27 @@ static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp)
 		   rdp->n_rp_need_nothing);
 }
 
-static int show_rcu_pending(struct seq_file *m, void *unused)
-{
-	int cpu;
-	struct rcu_state *rsp;
-
-	for_each_rcu_flavor(rsp) {
-		seq_printf(m, "%s:\n", rsp->name);
-		for_each_possible_cpu(cpu)
-			print_one_rcu_pending(m, per_cpu_ptr(rsp->rda, cpu));
-	}
-	return 0;
-}
-
-static int rcu_pending_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, show_rcu_pending, NULL);
-}
-
-static const struct file_operations rcu_pending_fops = {
-	.owner = THIS_MODULE,
-	.open = rcu_pending_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-static int new_show_rcu_pending(struct seq_file *m, void *v)
+static int show_rcu_pending(struct seq_file *m, void *v)
 {
 	print_one_rcu_pending(m, (struct rcu_data *)v);
 	return 0;
 }
 
-static const struct seq_operations new_rcu_pending_op = {
+static const struct seq_operations rcu_pending_op = {
 	.start = r_start,
 	.next  = r_next,
 	.stop  = r_stop,
-	.show  = new_show_rcu_pending,
+	.show  = show_rcu_pending,
 };
 
-static int new_rcu_pending_open(struct inode *inode, struct file *file)
+static int rcu_pending_open(struct inode *inode, struct file *file)
 {
-	return r_open(inode, file, &new_rcu_pending_op);
+	return r_open(inode, file, &rcu_pending_op);
 }
 
-static const struct file_operations new_rcu_pending_fops = {
+static const struct file_operations rcu_pending_fops = {
 	.owner = THIS_MODULE,
-	.open = new_rcu_pending_open,
+	.open = rcu_pending_open,
 	.read = seq_read,
 	.llseek = no_llseek,
 	.release = seq_release,
@@ -577,17 +492,17 @@ static int __init rcutree_trace_init(void)
 			goto free_out;
 
 			retval = debugfs_create_file("rcudata", 0444,
-					rspdir, rsp, &new_rcudata_fops);
+					rspdir, rsp, &rcudata_fops);
 			if (!retval)
 				goto free_out;
 
 			retval = debugfs_create_file("rcudata.csv", 0444,
-					rspdir, rsp, &new_rcudata_csv_fops);
+					rspdir, rsp, &rcudata_csv_fops);
 			if (!retval)
 				goto free_out;
 
 			retval = debugfs_create_file("rcu_pending", 0444,
-					rspdir, rsp, &new_rcu_pending_fops);
+					rspdir, rsp, &rcu_pending_fops);
 			if (!retval)
 				goto free_out;
 	}
@@ -597,16 +512,6 @@ static int __init rcutree_trace_init(void)
 	if (!retval)
 		goto free_out;
 
-	retval = debugfs_create_file("rcudata", 0444, rcudir,
-						NULL, &rcudata_fops);
-	if (!retval)
-		goto free_out;
-
-	retval = debugfs_create_file("rcudata.csv", 0444, rcudir,
-						NULL, &rcudata_csv_fops);
-	if (!retval)
-		goto free_out;
-
 	if (rcu_boost_trace_create_file(rcudir))
 		goto free_out;
 
@@ -619,11 +524,6 @@ static int __init rcutree_trace_init(void)
 	if (!retval)
 		goto free_out;
 
-	retval = debugfs_create_file("rcu_pending", 0444, rcudir,
-						NULL, &rcu_pending_fops);
-	if (!retval)
-		goto free_out;
-
 	retval = debugfs_create_file("rcutorture", 0444, rcudir,
 						NULL, &rcutorture_fops);
 	if (!retval)
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 07/14] rcu: Remove the interface "rcudata.csv"
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
                     ` (4 preceding siblings ...)
  2012-10-30 17:05   ` [PATCH tip/core/rcu 06/14] rcu: Replace the old interface with the new one Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 08/14] rcu: Fix tracing formatting Paul E. McKenney
                     ` (6 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch removes the interface "rcudata.csv" since it is apparently
not used.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |   76 ------------------------------------------------
 1 files changed, 0 insertions(+), 76 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 0e2ab64..bcc4865 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -174,77 +174,6 @@ static const struct file_operations rcudata_fops = {
 	.release = seq_release,
 };
 
-static void print_one_rcu_data_csv(struct seq_file *m, struct rcu_data *rdp)
-{
-	if (!rdp->beenonline)
-		return;
-	seq_printf(m, "%d,%s,%lu,%lu,%d,%d",
-		   rdp->cpu,
-		   cpu_is_offline(rdp->cpu) ? "\"N\"" : "\"Y\"",
-		   rdp->completed, rdp->gpnum,
-		   rdp->passed_quiesce, rdp->qs_pending);
-	seq_printf(m, ",%d,%llx,%d,%lu",
-		   atomic_read(&rdp->dynticks->dynticks),
-		   rdp->dynticks->dynticks_nesting,
-		   rdp->dynticks->dynticks_nmi_nesting,
-		   rdp->dynticks_fqs);
-	seq_printf(m, ",%lu", rdp->offline_fqs);
-	seq_printf(m, ",%ld,%ld,\"%c%c%c%c\"", rdp->qlen_lazy, rdp->qlen,
-		   ".N"[rdp->nxttail[RCU_NEXT_READY_TAIL] !=
-			rdp->nxttail[RCU_NEXT_TAIL]],
-		   ".R"[rdp->nxttail[RCU_WAIT_TAIL] !=
-			rdp->nxttail[RCU_NEXT_READY_TAIL]],
-		   ".W"[rdp->nxttail[RCU_DONE_TAIL] !=
-			rdp->nxttail[RCU_WAIT_TAIL]],
-		   ".D"[&rdp->nxtlist != rdp->nxttail[RCU_DONE_TAIL]]);
-#ifdef CONFIG_RCU_BOOST
-	seq_printf(m, ",%d,\"%c\"",
-		   per_cpu(rcu_cpu_has_work, rdp->cpu),
-		   convert_kthread_status(per_cpu(rcu_cpu_kthread_status,
-					  rdp->cpu)));
-#endif /* #ifdef CONFIG_RCU_BOOST */
-	seq_printf(m, ",%ld", rdp->blimit);
-	seq_printf(m, ",%lu,%lu,%lu\n",
-		   rdp->n_cbs_invoked, rdp->n_cbs_orphaned, rdp->n_cbs_adopted);
-}
-
-static int show_rcudata_csv(struct seq_file *m, void *v)
-{
-	struct rcu_data *rdp = (struct rcu_data *)v;
-	if (cpumask_first(cpu_possible_mask) == rdp->cpu) {
-		seq_puts(m, "\"CPU\",\"Online?\",\"c\",\"g\",\"pq\",\"pq\",");
-		seq_puts(m, "\"dt\",\"dt nesting\",\"dt NMI nesting\",\"df\",");
-		seq_puts(m, "\"of\",\"qll\",\"ql\",\"qs\"");
-#ifdef CONFIG_RCU_BOOST
-		seq_puts(m, "\"kt\",\"ktl\"");
-#endif /* #ifdef CONFIG_RCU_BOOST */
-		seq_puts(m, ",\"b\",\"ci\",\"co\",\"ca\"\n");
-	}
-
-	print_one_rcu_data_csv(m, rdp);
-	return 0;
-}
-
-static const struct seq_operations rcudate_csv_op = {
-	.start = r_start,
-	.next  = r_next,
-	.stop  = r_stop,
-	.show  = show_rcudata_csv,
-};
-
-static int rcudata_csv_open(struct inode *inode, struct file *file)
-{
-	return r_open(inode, file, &rcudate_csv_op);
-}
-
-static const struct file_operations rcudata_csv_fops = {
-	.owner = THIS_MODULE,
-	.open = rcudata_csv_open,
-	.read = seq_read,
-	.llseek = no_llseek,
-	.release = seq_release,
-};
-
 #ifdef CONFIG_RCU_BOOST
 
 static void print_one_rcu_node_boost(struct seq_file *m, struct rcu_node *rnp)
@@ -496,11 +425,6 @@ static int __init rcutree_trace_init(void)
 			if (!retval)
 				goto free_out;
 
-			retval = debugfs_create_file("rcudata.csv", 0444,
-					rspdir, rsp, &rcudata_csv_fops);
-			if (!retval)
-				goto free_out;
-
 			retval = debugfs_create_file("rcu_pending", 0444,
 					rspdir, rsp, &rcu_pending_fops);
 			if (!retval)
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 08/14] rcu: Fix tracing formatting
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
                     ` (5 preceding siblings ...)
  2012-10-30 17:05   ` [PATCH tip/core/rcu 07/14] rcu: Remove the interface "rcudata.csv" Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 09/14] rcu: split 'rcubarrier' to each flavor Paul E. McKenney
                     ` (5 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Paul E. McKenney

From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>

The rcu_state structure's ->completed field is unsigned long, so this
commit adjusts show_one_rcugp()'s printf() format to suit.  Also add
the required ACCESS_ONCE() directives while we are in this function.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree.c       |    4 ++--
 kernel/rcutree_trace.c |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index b966d56..8ed9c48 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -68,8 +68,8 @@ static struct lock_class_key rcu_fqs_class[RCU_NUM_LVLS];
 	.level = { &sname##_state.node[0] }, \
 	.call = cr, \
 	.fqs_state = RCU_GP_IDLE, \
-	.gpnum = -300, \
-	.completed = -300, \
+	.gpnum = 0UL - 300UL, \
+	.completed = 0UL - 300UL, \
 	.orphan_lock = __RAW_SPIN_LOCK_UNLOCKED(&sname##_state.orphan_lock), \
 	.orphan_nxttail = &sname##_state.orphan_nxtlist, \
 	.orphan_donetail = &sname##_state.orphan_donelist, \
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index bcc4865..209e696 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -301,15 +301,15 @@ static void show_one_rcugp(struct seq_file *m, struct rcu_state *rsp)
 	struct rcu_node *rnp = &rsp->node[0];
 
 	raw_spin_lock_irqsave(&rnp->lock, flags);
-	completed = rsp->completed;
-	gpnum = rsp->gpnum;
-	if (rsp->completed == rsp->gpnum)
+	completed = ACCESS_ONCE(rsp->completed);
+	gpnum = ACCESS_ONCE(rsp->gpnum);
+	if (completed == gpnum)
 		gpage = 0;
 	else
 		gpage = jiffies - rsp->gp_start;
 	gpmax = rsp->gp_max;
 	raw_spin_unlock_irqrestore(&rnp->lock, flags);
-	seq_printf(m, "%s: completed=%ld  gpnum=%lu  age=%ld  max=%ld\n",
+	seq_printf(m, "%s: completed=%lu  gpnum=%lu  age=%ld  max=%ld\n",
 		   rsp->name, completed, gpnum, gpage, gpmax);
 }
 
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 09/14] rcu: split 'rcubarrier' to each flavor
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
                     ` (6 preceding siblings ...)
  2012-10-30 17:05   ` [PATCH tip/core/rcu 08/14] rcu: Fix tracing formatting Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 10/14] rcu: split 'rcuboost' " Paul E. McKenney
                     ` (4 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch add new 'rcubarrier' to each flavor's folder, now we could use:
	'cat /debugfs/rcu/rsp/rcubarrier'
to get the selected rsp info.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 209e696..8b03bfb 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -101,6 +101,28 @@ static const struct file_operations rcubarrier_fops = {
 	.release = single_release,
 };
 
+static int new_show_rcubarrier(struct seq_file *m, void *v)
+{
+	struct rcu_state *rsp = (struct rcu_state *)m->private;
+	seq_printf(m, "bcc: %d nbd: %lu\n",
+		   atomic_read(&rsp->barrier_cpu_count),
+		   rsp->n_barrier_done);
+	return 0;
+}
+
+static int new_rcubarrier_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, new_show_rcubarrier, inode->i_private);
+}
+
+static const struct file_operations new_rcubarrier_fops = {
+	.owner = THIS_MODULE,
+	.open = new_rcubarrier_open,
+	.read = seq_read,
+	.llseek = no_llseek,
+	.release = seq_release,
+};
+
 #ifdef CONFIG_RCU_BOOST
 
 static char convert_kthread_status(unsigned int kthread_status)
@@ -429,6 +451,11 @@ static int __init rcutree_trace_init(void)
 					rspdir, rsp, &rcu_pending_fops);
 			if (!retval)
 				goto free_out;
+
+			retval = debugfs_create_file("rcubarrier", 0444,
+					rspdir, rsp, &new_rcubarrier_fops);
+			if (!retval)
+				goto free_out;
 	}
 
 	retval = debugfs_create_file("rcubarrier", 0444, rcudir,
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 10/14] rcu: split 'rcuboost' to each flavor
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
                     ` (7 preceding siblings ...)
  2012-10-30 17:05   ` [PATCH tip/core/rcu 09/14] rcu: split 'rcubarrier' to each flavor Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 11/14] rcu: split 'rcugp' " Paul E. McKenney
                     ` (3 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch add new 'rcuboost' to each flavor's folder, now we could use:
	'cat /debugfs/rcu/rsp/rcuboost'
to get the selected rsp info.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 8b03bfb..b6fd147 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -239,7 +239,7 @@ static const struct file_operations rcu_node_boost_fops = {
 	.owner = THIS_MODULE,
 	.open = rcu_node_boost_open,
 	.read = seq_read,
-	.llseek = seq_lseek,
+	.llseek = no_llseek,
 	.release = single_release,
 };
 
@@ -456,6 +456,15 @@ static int __init rcutree_trace_init(void)
 					rspdir, rsp, &new_rcubarrier_fops);
 			if (!retval)
 				goto free_out;
+
+#ifdef CONFIG_RCU_BOOST
+			if (rsp == &rcu_preempt_state) {
+				retval = debugfs_create_file("rcuboost", 0444,
+					rspdir, NULL, &rcu_node_boost_fops);
+				if (!retval)
+					goto free_out;
+			}
+#endif
 	}
 
 	retval = debugfs_create_file("rcubarrier", 0444, rcudir,
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 11/14] rcu: split 'rcugp' to each flavor
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
                     ` (8 preceding siblings ...)
  2012-10-30 17:05   ` [PATCH tip/core/rcu 10/14] rcu: split 'rcuboost' " Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 12/14] rcu: split 'rcuhier' " Paul E. McKenney
                     ` (2 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch add new 'rcugp' to each flavor's folder, now we could use:
	'cat /debugfs/rcu/rsp/rcugp'
to get the selected rsp info.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index b6fd147..bbfb6e2 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -357,6 +357,26 @@ static const struct file_operations rcugp_fops = {
 	.release = single_release,
 };
 
+static int new_show_rcugp(struct seq_file *m, void *v)
+{
+	struct rcu_state *rsp = (struct rcu_state *)m->private;
+	show_one_rcugp(m, rsp);
+	return 0;
+}
+
+static int new_rcugp_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, new_show_rcugp, inode->i_private);
+}
+
+static const struct file_operations new_rcugp_fops = {
+	.owner = THIS_MODULE,
+	.open = new_rcugp_open,
+	.read = seq_read,
+	.llseek = no_llseek,
+	.release = seq_release,
+};
+
 static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp)
 {
 	if (!rdp->beenonline)
@@ -465,6 +485,12 @@ static int __init rcutree_trace_init(void)
 					goto free_out;
 			}
 #endif
+
+			retval = debugfs_create_file("rcugp", 0444,
+					rspdir, rsp, &new_rcugp_fops);
+			if (!retval)
+				goto free_out;
+
 	}
 
 	retval = debugfs_create_file("rcubarrier", 0444, rcudir,
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 12/14] rcu: split 'rcuhier' to each flavor
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
                     ` (9 preceding siblings ...)
  2012-10-30 17:05   ` [PATCH tip/core/rcu 11/14] rcu: split 'rcugp' " Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 13/14] rcu: Remove old debugfs interfaces and also RCU flavor name Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 14/14] rcu: Add tracing for synchronize_sched_expedited() Paul E. McKenney
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This patch add new 'rcuhier' to each flavor's folder, now we could use:
	'cat /debugfs/rcu/rsp/rcuhier'
to get the selected rsp info.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index bbfb6e2..db46464 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -313,6 +313,26 @@ static const struct file_operations rcuhier_fops = {
 	.release = single_release,
 };
 
+static int new_show_rcuhier(struct seq_file *m, void *v)
+{
+	struct rcu_state *rsp = (struct rcu_state *)m->private;
+	print_one_rcu_state(m, rsp);
+	return 0;
+}
+
+static int new_rcuhier_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, new_show_rcuhier, inode->i_private);
+}
+
+static const struct file_operations new_rcuhier_fops = {
+	.owner = THIS_MODULE,
+	.open = new_rcuhier_open,
+	.read = seq_read,
+	.llseek = no_llseek,
+	.release = seq_release,
+};
+
 static void show_one_rcugp(struct seq_file *m, struct rcu_state *rsp)
 {
 	unsigned long flags;
@@ -491,6 +511,10 @@ static int __init rcutree_trace_init(void)
 			if (!retval)
 				goto free_out;
 
+			retval = debugfs_create_file("rcuhier", 0444,
+					rspdir, rsp, &new_rcuhier_fops);
+			if (!retval)
+				goto free_out;
 	}
 
 	retval = debugfs_create_file("rcubarrier", 0444, rcudir,
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 13/14] rcu: Remove old debugfs interfaces and also RCU flavor name
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
                     ` (10 preceding siblings ...)
  2012-10-30 17:05   ` [PATCH tip/core/rcu 12/14] rcu: split 'rcuhier' " Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  2012-10-30 17:05   ` [PATCH tip/core/rcu 14/14] rcu: Add tracing for synchronize_sched_expedited() Paul E. McKenney
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Michael Wang, Paul E. McKenney

From: Michael Wang <wangyun@linux.vnet.ibm.com>

This commit removes the old debugfs interfaces, so that the new
directory-per-RCU-flavor versions remain.  Because the RCU flavor is
given by the directory name, there is no need to print it out, so remove
the name from the printout.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |  190 +++++++++++-------------------------------------
 1 files changed, 44 insertions(+), 146 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index db46464..c6f9cb3 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -76,32 +76,7 @@ static void r_stop(struct seq_file *m, void *v)
 {
 }
 
-static int show_rcubarrier(struct seq_file *m, void *unused)
-{
-	struct rcu_state *rsp;
-
-	for_each_rcu_flavor(rsp)
-		seq_printf(m, "%s: bcc: %d nbd: %lu\n",
-			   rsp->name,
-			   atomic_read(&rsp->barrier_cpu_count),
-			   rsp->n_barrier_done);
-	return 0;
-}
-
-static int rcubarrier_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, show_rcubarrier, NULL);
-}
-
-static const struct file_operations rcubarrier_fops = {
-	.owner = THIS_MODULE,
-	.open = rcubarrier_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-static int new_show_rcubarrier(struct seq_file *m, void *v)
+static int show_rcubarrier(struct seq_file *m, void *v)
 {
 	struct rcu_state *rsp = (struct rcu_state *)m->private;
 	seq_printf(m, "bcc: %d nbd: %lu\n",
@@ -110,14 +85,14 @@ static int new_show_rcubarrier(struct seq_file *m, void *v)
 	return 0;
 }
 
-static int new_rcubarrier_open(struct inode *inode, struct file *file)
+static int rcubarrier_open(struct inode *inode, struct file *file)
 {
-	return single_open(file, new_show_rcubarrier, inode->i_private);
+	return single_open(file, show_rcubarrier, inode->i_private);
 }
 
-static const struct file_operations new_rcubarrier_fops = {
+static const struct file_operations rcubarrier_fops = {
 	.owner = THIS_MODULE,
-	.open = new_rcubarrier_open,
+	.open = rcubarrier_open,
 	.read = seq_read,
 	.llseek = no_llseek,
 	.release = seq_release,
@@ -243,23 +218,7 @@ static const struct file_operations rcu_node_boost_fops = {
 	.release = single_release,
 };
 
-/*
- * Create the rcuboost debugfs entry.  Standard error return.
- */
-static int rcu_boost_trace_create_file(struct dentry *rcudir)
-{
-	return !debugfs_create_file("rcuboost", 0444, rcudir, NULL,
-				    &rcu_node_boost_fops);
-}
-
-#else /* #ifdef CONFIG_RCU_BOOST */
-
-static int rcu_boost_trace_create_file(struct dentry *rcudir)
-{
-	return 0;  /* There cannot be an error if we didn't create it! */
-}
-
-#endif /* #else #ifdef CONFIG_RCU_BOOST */
+#endif /* #ifdef CONFIG_RCU_BOOST */
 
 static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
 {
@@ -268,8 +227,8 @@ static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
 	struct rcu_node *rnp;
 
 	gpnum = rsp->gpnum;
-	seq_printf(m, "%s: c=%lu g=%lu s=%d jfq=%ld j=%x ",
-		   rsp->name, rsp->completed, gpnum, rsp->fqs_state,
+	seq_printf(m, "c=%lu g=%lu s=%d jfq=%ld j=%x ",
+		   rsp->completed, gpnum, rsp->fqs_state,
 		   (long)(rsp->jiffies_force_qs - jiffies),
 		   (int)(jiffies & 0xffff));
 	seq_printf(m, "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu oqlen=%ld/%ld\n",
@@ -291,44 +250,22 @@ static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
 	seq_puts(m, "\n");
 }
 
-static int show_rcuhier(struct seq_file *m, void *unused)
+static int show_rcuhier(struct seq_file *m, void *v)
 {
-	struct rcu_state *rsp;
-
-	for_each_rcu_flavor(rsp)
-		print_one_rcu_state(m, rsp);
+	struct rcu_state *rsp = (struct rcu_state *)m->private;
+	print_one_rcu_state(m, rsp);
 	return 0;
 }
 
 static int rcuhier_open(struct inode *inode, struct file *file)
 {
-	return single_open(file, show_rcuhier, NULL);
+	return single_open(file, show_rcuhier, inode->i_private);
 }
 
 static const struct file_operations rcuhier_fops = {
 	.owner = THIS_MODULE,
 	.open = rcuhier_open,
 	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-static int new_show_rcuhier(struct seq_file *m, void *v)
-{
-	struct rcu_state *rsp = (struct rcu_state *)m->private;
-	print_one_rcu_state(m, rsp);
-	return 0;
-}
-
-static int new_rcuhier_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, new_show_rcuhier, inode->i_private);
-}
-
-static const struct file_operations new_rcuhier_fops = {
-	.owner = THIS_MODULE,
-	.open = new_rcuhier_open,
-	.read = seq_read,
 	.llseek = no_llseek,
 	.release = seq_release,
 };
@@ -351,48 +288,26 @@ static void show_one_rcugp(struct seq_file *m, struct rcu_state *rsp)
 		gpage = jiffies - rsp->gp_start;
 	gpmax = rsp->gp_max;
 	raw_spin_unlock_irqrestore(&rnp->lock, flags);
-	seq_printf(m, "%s: completed=%lu  gpnum=%lu  age=%ld  max=%ld\n",
-		   rsp->name, completed, gpnum, gpage, gpmax);
+	seq_printf(m, "completed=%lu  gpnum=%lu  age=%ld  max=%ld\n",
+		   completed, gpnum, gpage, gpmax);
 }
 
-static int show_rcugp(struct seq_file *m, void *unused)
+static int show_rcugp(struct seq_file *m, void *v)
 {
-	struct rcu_state *rsp;
-
-	for_each_rcu_flavor(rsp)
-		show_one_rcugp(m, rsp);
+	struct rcu_state *rsp = (struct rcu_state *)m->private;
+	show_one_rcugp(m, rsp);
 	return 0;
 }
 
 static int rcugp_open(struct inode *inode, struct file *file)
 {
-	return single_open(file, show_rcugp, NULL);
+	return single_open(file, show_rcugp, inode->i_private);
 }
 
 static const struct file_operations rcugp_fops = {
 	.owner = THIS_MODULE,
 	.open = rcugp_open,
 	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-static int new_show_rcugp(struct seq_file *m, void *v)
-{
-	struct rcu_state *rsp = (struct rcu_state *)m->private;
-	show_one_rcugp(m, rsp);
-	return 0;
-}
-
-static int new_rcugp_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, new_show_rcugp, inode->i_private);
-}
-
-static const struct file_operations new_rcugp_fops = {
-	.owner = THIS_MODULE,
-	.open = new_rcugp_open,
-	.read = seq_read,
 	.llseek = no_llseek,
 	.release = seq_release,
 };
@@ -482,57 +397,40 @@ static int __init rcutree_trace_init(void)
 		if (!rspdir)
 			goto free_out;
 
-			retval = debugfs_create_file("rcudata", 0444,
-					rspdir, rsp, &rcudata_fops);
-			if (!retval)
-				goto free_out;
+		retval = debugfs_create_file("rcudata", 0444,
+				rspdir, rsp, &rcudata_fops);
+		if (!retval)
+			goto free_out;
 
-			retval = debugfs_create_file("rcu_pending", 0444,
-					rspdir, rsp, &rcu_pending_fops);
-			if (!retval)
-				goto free_out;
+		retval = debugfs_create_file("rcu_pending", 0444,
+				rspdir, rsp, &rcu_pending_fops);
+		if (!retval)
+			goto free_out;
 
-			retval = debugfs_create_file("rcubarrier", 0444,
-					rspdir, rsp, &new_rcubarrier_fops);
-			if (!retval)
-				goto free_out;
+		retval = debugfs_create_file("rcubarrier", 0444,
+				rspdir, rsp, &rcubarrier_fops);
+		if (!retval)
+			goto free_out;
 
 #ifdef CONFIG_RCU_BOOST
-			if (rsp == &rcu_preempt_state) {
-				retval = debugfs_create_file("rcuboost", 0444,
-					rspdir, NULL, &rcu_node_boost_fops);
-				if (!retval)
-					goto free_out;
-			}
-#endif
-
-			retval = debugfs_create_file("rcugp", 0444,
-					rspdir, rsp, &new_rcugp_fops);
+		if (rsp == &rcu_preempt_state) {
+			retval = debugfs_create_file("rcuboost", 0444,
+				rspdir, NULL, &rcu_node_boost_fops);
 			if (!retval)
 				goto free_out;
+		}
+#endif
 
-			retval = debugfs_create_file("rcuhier", 0444,
-					rspdir, rsp, &new_rcuhier_fops);
-			if (!retval)
-				goto free_out;
-	}
-
-	retval = debugfs_create_file("rcubarrier", 0444, rcudir,
-						NULL, &rcubarrier_fops);
-	if (!retval)
-		goto free_out;
-
-	if (rcu_boost_trace_create_file(rcudir))
-		goto free_out;
-
-	retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops);
-	if (!retval)
-		goto free_out;
+		retval = debugfs_create_file("rcugp", 0444,
+				rspdir, rsp, &rcugp_fops);
+		if (!retval)
+			goto free_out;
 
-	retval = debugfs_create_file("rcuhier", 0444, rcudir,
-						NULL, &rcuhier_fops);
-	if (!retval)
-		goto free_out;
+		retval = debugfs_create_file("rcuhier", 0444,
+				rspdir, rsp, &rcuhier_fops);
+		if (!retval)
+			goto free_out;
+	}
 
 	retval = debugfs_create_file("rcutorture", 0444, rcudir,
 						NULL, &rcutorture_fops);
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH tip/core/rcu 14/14] rcu: Add tracing for synchronize_sched_expedited()
  2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
                     ` (11 preceding siblings ...)
  2012-10-30 17:05   ` [PATCH tip/core/rcu 13/14] rcu: Remove old debugfs interfaces and also RCU flavor name Paul E. McKenney
@ 2012-10-30 17:05   ` Paul E. McKenney
  12 siblings, 0 replies; 15+ messages in thread
From: Paul E. McKenney @ 2012-10-30 17:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
	peterz, rostedt, Valdis.Kletnieks, dhowells, edumazet, darren,
	fweisbec, sbw, patches, Paul E. McKenney, Paul E. McKenney

From: "Paul E. McKenney" <paul.mckenney@linaro.org>

This commit adds a per-RCU-flavor "rcuexp" file that dumps out
statistics for synchonize_sched_expedited().

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcutree_trace.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index c6f9cb3..e84679c 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -171,6 +171,45 @@ static const struct file_operations rcudata_fops = {
 	.release = seq_release,
 };
 
+static int show_rcuexp(struct seq_file *m, void *v)
+{
+	struct rcu_state *rsp = (struct rcu_state *)v;
+
+	seq_printf(m, "s=%lu d=%lu w=%lu tf=%lu wd1=%lu wd2=%lu n=%lu sc=%lu dt=%lu dl=%lu dx=%lu",
+		   atomic_long_read(&rsp->expedited_start),
+		   atomic_long_read(&rsp->expedited_done),
+		   atomic_long_read(&rsp->expedited_wrap),
+		   atomic_long_read(&rsp->expedited_tryfail),
+		   atomic_long_read(&rsp->expedited_workdone1),
+		   atomic_long_read(&rsp->expedited_workdone2),
+		   atomic_long_read(&rsp->expedited_normal),
+		   atomic_long_read(&rsp->expedited_stoppedcpus),
+		   atomic_long_read(&rsp->expedited_done_tries),
+		   atomic_long_read(&rsp->expedited_done_lost),
+		   atomic_long_read(&rsp->expedited_done_exit));
+	return 0;
+}
+
+static const struct seq_operations rcuexp_op = {
+	.start = r_start,
+	.next  = r_next,
+	.stop  = r_stop,
+	.show  = show_rcuexp,
+};
+
+static int rcuexp_open(struct inode *inode, struct file *file)
+{
+	return r_open(inode, file, &rcuexp_op);
+}
+
+static const struct file_operations rcuexp_fops = {
+	.owner = THIS_MODULE,
+	.open = rcuexp_open,
+	.read = seq_read,
+	.llseek = no_llseek,
+	.release = seq_release,
+};
+
 #ifdef CONFIG_RCU_BOOST
 
 static void print_one_rcu_node_boost(struct seq_file *m, struct rcu_node *rnp)
@@ -402,6 +441,11 @@ static int __init rcutree_trace_init(void)
 		if (!retval)
 			goto free_out;
 
+		retval = debugfs_create_file("rcuexp", 0444,
+				rspdir, rsp, &rcuexp_fops);
+		if (!retval)
+			goto free_out;
+
 		retval = debugfs_create_file("rcu_pending", 0444,
 				rspdir, rsp, &rcu_pending_fops);
 		if (!retval)
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-10-30 17:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-30 17:04 [PATCH tip/core/rcu 0/14] Tracing changes for 3.8 Paul E. McKenney
2012-10-30 17:05 ` [PATCH tip/core/rcu 01/14] rcu: Create directory for each flavor of rcu Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 02/14] rcu: Fundamental facility for 'CPU units sequence reading' Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 03/14] rcu: Optimize the 'rcudata' for RCU trace Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 04/14] rcu: Optimize the 'rcudata.csv' " Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 05/14] rcu: Optimize the 'rcu_pending' " Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 06/14] rcu: Replace the old interface with the new one Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 07/14] rcu: Remove the interface "rcudata.csv" Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 08/14] rcu: Fix tracing formatting Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 09/14] rcu: split 'rcubarrier' to each flavor Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 10/14] rcu: split 'rcuboost' " Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 11/14] rcu: split 'rcugp' " Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 12/14] rcu: split 'rcuhier' " Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 13/14] rcu: Remove old debugfs interfaces and also RCU flavor name Paul E. McKenney
2012-10-30 17:05   ` [PATCH tip/core/rcu 14/14] rcu: Add tracing for synchronize_sched_expedited() Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.