Commit 72bb749e authored by Paul E. McKenney's avatar Paul E. McKenney

refperf: Add test for RCU Tasks Trace readers.

This commit adds testing for RCU Tasks Trace readers to the refperf module.
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 918b351d
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/notifier.h> #include <linux/notifier.h>
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
#include <linux/rcupdate_trace.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
...@@ -157,7 +158,6 @@ static struct ref_perf_ops rcu_ops = { ...@@ -157,7 +158,6 @@ static struct ref_perf_ops rcu_ops = {
.name = "rcu" .name = "rcu"
}; };
// Definitions for SRCU ref perf testing. // Definitions for SRCU ref perf testing.
DEFINE_STATIC_SRCU(srcu_refctl_perf); DEFINE_STATIC_SRCU(srcu_refctl_perf);
static struct srcu_struct *srcu_ctlp = &srcu_refctl_perf; static struct srcu_struct *srcu_ctlp = &srcu_refctl_perf;
...@@ -192,6 +192,35 @@ static struct ref_perf_ops srcu_ops = { ...@@ -192,6 +192,35 @@ static struct ref_perf_ops srcu_ops = {
.name = "srcu" .name = "srcu"
}; };
// Definitions for RCU Tasks Trace ref perf testing.
static void rcu_trace_ref_perf_read_section(const int nloops)
{
int i;
for (i = nloops; i >= 0; i--) {
rcu_read_lock_trace();
rcu_read_unlock_trace();
}
}
static void rcu_trace_ref_perf_delay_section(const int nloops, const int udl, const int ndl)
{
int i;
for (i = nloops; i >= 0; i--) {
rcu_read_lock_trace();
un_delay(udl, ndl);
rcu_read_unlock_trace();
}
}
static struct ref_perf_ops rcu_trace_ops = {
.init = rcu_sync_perf_init,
.readsection = rcu_trace_ref_perf_read_section,
.delaysection = rcu_trace_ref_perf_delay_section,
.name = "rcu-trace"
};
// Definitions for reference count // Definitions for reference count
static atomic_t refcnt; static atomic_t refcnt;
...@@ -584,7 +613,7 @@ ref_perf_init(void) ...@@ -584,7 +613,7 @@ ref_perf_init(void)
long i; long i;
int firsterr = 0; int firsterr = 0;
static struct ref_perf_ops *perf_ops[] = { static struct ref_perf_ops *perf_ops[] = {
&rcu_ops, &srcu_ops, &refcnt_ops, &rwlock_ops, &rwsem_ops, &rcu_ops, &srcu_ops, &rcu_trace_ops, &refcnt_ops, &rwlock_ops, &rwsem_ops,
}; };
if (!torture_init_begin(perf_type, verbose)) if (!torture_init_begin(perf_type, verbose))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment