Skip to content

Commit

Permalink
refperf: Add test for RCU Tasks readers
Browse files Browse the repository at this point in the history
This commit adds testing for RCU Tasks readers to the refperf module.
This also applies to RCU Rude readers, as both flavors have empty
(as in non-existent) read-side markers.

Signed-off-by: Paul E. McKenney <[email protected]>
  • Loading branch information
paulmckrcu committed Jun 29, 2020
1 parent 72bb749 commit e13ef44
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion kernel/rcu/refperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,31 @@ static struct ref_perf_ops srcu_ops = {
.name = "srcu"
};

// Definitions for RCU Tasks ref perf testing: Empty read markers.
// These definitions also work for RCU Rude readers.
static void rcu_tasks_ref_perf_read_section(const int nloops)
{
int i;

for (i = nloops; i >= 0; i--)
continue;
}

static void rcu_tasks_ref_perf_delay_section(const int nloops, const int udl, const int ndl)
{
int i;

for (i = nloops; i >= 0; i--)
un_delay(udl, ndl);
}

static struct ref_perf_ops rcu_tasks_ops = {
.init = rcu_sync_perf_init,
.readsection = rcu_tasks_ref_perf_read_section,
.delaysection = rcu_tasks_ref_perf_delay_section,
.name = "rcu-tasks"
};

// Definitions for RCU Tasks Trace ref perf testing.
static void rcu_trace_ref_perf_read_section(const int nloops)
{
Expand Down Expand Up @@ -613,7 +638,8 @@ ref_perf_init(void)
long i;
int firsterr = 0;
static struct ref_perf_ops *perf_ops[] = {
&rcu_ops, &srcu_ops, &rcu_trace_ops, &refcnt_ops, &rwlock_ops, &rwsem_ops,
&rcu_ops, &srcu_ops, &rcu_trace_ops, &rcu_tasks_ops,
&refcnt_ops, &rwlock_ops, &rwsem_ops,
};

if (!torture_init_begin(perf_type, verbose))
Expand Down

0 comments on commit e13ef44

Please sign in to comment.