Skip to content

Commit e13ef44

Browse files
committed
refperf: Add test for RCU Tasks readers
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]>
1 parent 72bb749 commit e13ef44

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

kernel/rcu/refperf.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,31 @@ static struct ref_perf_ops srcu_ops = {
192192
.name = "srcu"
193193
};
194194

195+
// Definitions for RCU Tasks ref perf testing: Empty read markers.
196+
// These definitions also work for RCU Rude readers.
197+
static void rcu_tasks_ref_perf_read_section(const int nloops)
198+
{
199+
int i;
200+
201+
for (i = nloops; i >= 0; i--)
202+
continue;
203+
}
204+
205+
static void rcu_tasks_ref_perf_delay_section(const int nloops, const int udl, const int ndl)
206+
{
207+
int i;
208+
209+
for (i = nloops; i >= 0; i--)
210+
un_delay(udl, ndl);
211+
}
212+
213+
static struct ref_perf_ops rcu_tasks_ops = {
214+
.init = rcu_sync_perf_init,
215+
.readsection = rcu_tasks_ref_perf_read_section,
216+
.delaysection = rcu_tasks_ref_perf_delay_section,
217+
.name = "rcu-tasks"
218+
};
219+
195220
// Definitions for RCU Tasks Trace ref perf testing.
196221
static void rcu_trace_ref_perf_read_section(const int nloops)
197222
{
@@ -613,7 +638,8 @@ ref_perf_init(void)
613638
long i;
614639
int firsterr = 0;
615640
static struct ref_perf_ops *perf_ops[] = {
616-
&rcu_ops, &srcu_ops, &rcu_trace_ops, &refcnt_ops, &rwlock_ops, &rwsem_ops,
641+
&rcu_ops, &srcu_ops, &rcu_trace_ops, &rcu_tasks_ops,
642+
&refcnt_ops, &rwlock_ops, &rwsem_ops,
617643
};
618644

619645
if (!torture_init_begin(perf_type, verbose))

0 commit comments

Comments
 (0)