Skip to content

Commit a15ec57

Browse files
committed
rcuscale: Add RCU Tasks Rude testing
Add a "tasks-rude" option to the rcuscale.scale_type module parameter. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 271a846 commit a15ec57

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

kernel/rcu/rcu.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@ void show_rcu_tasks_gp_kthreads(void);
508508
# ifdef CONFIG_TASKS_RCU
509509
struct task_struct *get_rcu_tasks_gp_kthread(void);
510510
# endif // # ifdef CONFIG_TASKS_RCU
511+
# ifdef CONFIG_TASKS_RUDE_RCU
512+
struct task_struct *get_rcu_tasks_rude_gp_kthread(void);
513+
# endif // # ifdef CONFIG_TASKS_RUDE_RCU
511514
#else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
512515
static inline void show_rcu_tasks_gp_kthreads(void) {}
513516
#endif /* #else #ifdef CONFIG_TASKS_RCU_GENERIC */

kernel/rcu/rcuscale.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,35 @@ static struct rcu_scale_ops tasks_ops = {
310310

311311
#endif // #else // #ifdef CONFIG_TASKS_RCU
312312

313+
#ifdef CONFIG_TASKS_RUDE_RCU
314+
315+
/*
316+
* Definitions for RCU-tasks-rude scalability testing.
317+
*/
318+
319+
static struct rcu_scale_ops tasks_rude_ops = {
320+
.ptype = RCU_TASKS_RUDE_FLAVOR,
321+
.init = rcu_sync_scale_init,
322+
.readlock = tasks_scale_read_lock,
323+
.readunlock = tasks_scale_read_unlock,
324+
.get_gp_seq = rcu_no_completed,
325+
.gp_diff = rcu_seq_diff,
326+
.async = call_rcu_tasks_rude,
327+
.gp_barrier = rcu_barrier_tasks_rude,
328+
.sync = synchronize_rcu_tasks_rude,
329+
.exp_sync = synchronize_rcu_tasks_rude,
330+
.rso_gp_kthread = get_rcu_tasks_rude_gp_kthread,
331+
.name = "tasks-rude"
332+
};
333+
334+
#define TASKS_RUDE_OPS &tasks_rude_ops,
335+
336+
#else // #ifdef CONFIG_TASKS_RUDE_RCU
337+
338+
#define TASKS_RUDE_OPS
339+
340+
#endif // #else // #ifdef CONFIG_TASKS_RUDE_RCU
341+
313342
#ifdef CONFIG_TASKS_TRACE_RCU
314343

315344
/*
@@ -913,7 +942,7 @@ rcu_scale_init(void)
913942
long i;
914943
int firsterr = 0;
915944
static struct rcu_scale_ops *scale_ops[] = {
916-
&rcu_ops, &srcu_ops, &srcud_ops, TASKS_OPS TASKS_TRACING_OPS
945+
&rcu_ops, &srcu_ops, &srcud_ops, TASKS_OPS TASKS_RUDE_OPS TASKS_TRACING_OPS
917946
};
918947

919948
if (!torture_init_begin(scale_type, verbose))

kernel/rcu/tasks.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,13 @@ void show_rcu_tasks_rude_gp_kthread(void)
11941194
}
11951195
EXPORT_SYMBOL_GPL(show_rcu_tasks_rude_gp_kthread);
11961196
#endif // !defined(CONFIG_TINY_RCU)
1197+
1198+
struct task_struct *get_rcu_tasks_rude_gp_kthread(void)
1199+
{
1200+
return rcu_tasks_rude.kthread_ptr;
1201+
}
1202+
EXPORT_SYMBOL_GPL(get_rcu_tasks_rude_gp_kthread);
1203+
11971204
#endif /* #ifdef CONFIG_TASKS_RUDE_RCU */
11981205

11991206
////////////////////////////////////////////////////////////////////////

tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ CONFIG_RCU_SCALE_TEST=y
22
CONFIG_PRINTK_TIME=y
33
CONFIG_FORCE_TASKS_RCU=y
44
#CHECK#CONFIG_TASKS_RCU=y
5+
CONFIG_FORCE_TASKS_RUDE_RCU=y
6+
#CHECK#CONFIG_TASKS_RUDE_RCU=y
57
CONFIG_FORCE_TASKS_TRACE_RCU=y
68
#CHECK#CONFIG_TASKS_TRACE_RCU=y

0 commit comments

Comments
 (0)