|
25 | 25 | #include <linux/notifier.h>
|
26 | 26 | #include <linux/percpu.h>
|
27 | 27 | #include <linux/rcupdate.h>
|
| 28 | +#include <linux/rcupdate_trace.h> |
28 | 29 | #include <linux/reboot.h>
|
29 | 30 | #include <linux/sched.h>
|
30 | 31 | #include <linux/spinlock.h>
|
@@ -157,7 +158,6 @@ static struct ref_perf_ops rcu_ops = {
|
157 | 158 | .name = "rcu"
|
158 | 159 | };
|
159 | 160 |
|
160 |
| - |
161 | 161 | // Definitions for SRCU ref perf testing.
|
162 | 162 | DEFINE_STATIC_SRCU(srcu_refctl_perf);
|
163 | 163 | static struct srcu_struct *srcu_ctlp = &srcu_refctl_perf;
|
@@ -192,6 +192,35 @@ static struct ref_perf_ops srcu_ops = {
|
192 | 192 | .name = "srcu"
|
193 | 193 | };
|
194 | 194 |
|
| 195 | +// Definitions for RCU Tasks Trace ref perf testing. |
| 196 | +static void rcu_trace_ref_perf_read_section(const int nloops) |
| 197 | +{ |
| 198 | + int i; |
| 199 | + |
| 200 | + for (i = nloops; i >= 0; i--) { |
| 201 | + rcu_read_lock_trace(); |
| 202 | + rcu_read_unlock_trace(); |
| 203 | + } |
| 204 | +} |
| 205 | + |
| 206 | +static void rcu_trace_ref_perf_delay_section(const int nloops, const int udl, const int ndl) |
| 207 | +{ |
| 208 | + int i; |
| 209 | + |
| 210 | + for (i = nloops; i >= 0; i--) { |
| 211 | + rcu_read_lock_trace(); |
| 212 | + un_delay(udl, ndl); |
| 213 | + rcu_read_unlock_trace(); |
| 214 | + } |
| 215 | +} |
| 216 | + |
| 217 | +static struct ref_perf_ops rcu_trace_ops = { |
| 218 | + .init = rcu_sync_perf_init, |
| 219 | + .readsection = rcu_trace_ref_perf_read_section, |
| 220 | + .delaysection = rcu_trace_ref_perf_delay_section, |
| 221 | + .name = "rcu-trace" |
| 222 | +}; |
| 223 | + |
195 | 224 | // Definitions for reference count
|
196 | 225 | static atomic_t refcnt;
|
197 | 226 |
|
@@ -584,7 +613,7 @@ ref_perf_init(void)
|
584 | 613 | long i;
|
585 | 614 | int firsterr = 0;
|
586 | 615 | static struct ref_perf_ops *perf_ops[] = {
|
587 |
| - &rcu_ops, &srcu_ops, &refcnt_ops, &rwlock_ops, &rwsem_ops, |
| 616 | + &rcu_ops, &srcu_ops, &rcu_trace_ops, &refcnt_ops, &rwlock_ops, &rwsem_ops, |
588 | 617 | };
|
589 | 618 |
|
590 | 619 | if (!torture_init_begin(perf_type, verbose))
|
|
0 commit comments