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.
Unified · Split
| @@ -192,6 +192,31 @@ static struct ref_perf_ops srcu_ops = { · 191 unmodified lines | ||
| 192 | 192 | .name = "srcu" |
| 193 | 193 | }; |
| 194 | 194 | |
| 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 | + | |
| 195 | 220 | // Definitions for RCU Tasks Trace ref perf testing. |
| 196 | 221 | static void rcu_trace_ref_perf_read_section(const int nloops) |
| 197 | 222 | { |
| @@ -613,7 +638,8 @@ ref_perf_init(void) · 415 unmodified lines | ||
| 613 | 638 | long i; |
| 614 | 639 | int firsterr = 0; |
| 615 | 640 | 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, | |
| 617 | 643 | }; |
| 618 | 644 | |
| 619 | 645 | if (!torture_init_begin(perf_type, verbose)) |