summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-05-22 16:31:03 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-07-24 19:04:08 -0400
commit115a1a5285664f1931c30457081b4ae1e648f1f9 (patch)
tree42cb4036563415747705c102b62fa66fadb87493 /include
parent520eccdfe187591a51ea9ab4c1a024ae4d0f68d9 (diff)
rcutorture: Move SRCU status printing to SRCU implementations
This commit gets rid of some ugly #ifdefs in rcutorture.c by moving the SRCU status printing to the SRCU implementations. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/srcutiny.h13
-rw-r--r--include/linux/srcutree.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/srcutiny.h b/include/linux/srcutiny.h
index cfbfc540cafc..261471f407a5 100644
--- a/include/linux/srcutiny.h
+++ b/include/linux/srcutiny.h
@@ -87,4 +87,17 @@ static inline void srcu_barrier(struct srcu_struct *sp)
87 synchronize_srcu(sp); 87 synchronize_srcu(sp);
88} 88}
89 89
90/* Defined here to avoid size increase for non-torture kernels. */
91static inline void srcu_torture_stats_print(struct srcu_struct *sp,
92 char *tt, char *tf)
93{
94 int idx;
95
96 idx = READ_ONCE(sp->srcu_idx) & 0x1;
97 pr_alert("%s%s Tiny SRCU per-CPU(idx=%d): (%hd,%hd)\n",
98 tt, tf, idx,
99 READ_ONCE(sp->srcu_lock_nesting[!idx]),
100 READ_ONCE(sp->srcu_lock_nesting[idx]));
101}
102
90#endif 103#endif
diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h
index 42973f787e7e..7886356bdc84 100644
--- a/include/linux/srcutree.h
+++ b/include/linux/srcutree.h
@@ -141,5 +141,6 @@ void process_srcu(struct work_struct *work);
141 141
142void synchronize_srcu_expedited(struct srcu_struct *sp); 142void synchronize_srcu_expedited(struct srcu_struct *sp);
143void srcu_barrier(struct srcu_struct *sp); 143void srcu_barrier(struct srcu_struct *sp);
144void srcu_torture_stats_print(struct srcu_struct *sp, char *tt, char *tf);
144 145
145#endif 146#endif