Loading kernel/rcu/Kconfig.debug +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ config RCU_PERF_TEST select TORTURE_TEST select SRCU select TASKS_RCU select TASKS_RUDE_RCU default n help This option provides a kernel module that runs performance Loading @@ -46,6 +47,7 @@ config RCU_TORTURE_TEST select TORTURE_TEST select SRCU select TASKS_RCU select TASKS_RUDE_RCU default n help This option provides a kernel module that runs torture tests Loading kernel/rcu/rcu.h +1 −0 Original line number Diff line number Diff line Loading @@ -441,6 +441,7 @@ void rcu_request_urgent_qs_task(struct task_struct *t); enum rcutorture_type { RCU_FLAVOR, RCU_TASKS_FLAVOR, RCU_TASKS_RUDE_FLAVOR, RCU_TRIVIAL_FLAVOR, SRCU_FLAVOR, INVALID_RCU_FLAVOR Loading kernel/rcu/rcutorture.c +29 −2 Original line number Diff line number Diff line Loading @@ -730,6 +730,33 @@ static struct rcu_torture_ops trivial_ops = { .name = "trivial" }; /* * Definitions for rude RCU-tasks torture testing. */ static void rcu_tasks_rude_torture_deferred_free(struct rcu_torture *p) { call_rcu_tasks_rude(&p->rtort_rcu, rcu_torture_cb); } static struct rcu_torture_ops tasks_rude_ops = { .ttype = RCU_TASKS_RUDE_FLAVOR, .init = rcu_sync_torture_init, .readlock = rcu_torture_read_lock_trivial, .read_delay = rcu_read_delay, /* just reuse rcu's version. */ .readunlock = rcu_torture_read_unlock_trivial, .get_gp_seq = rcu_no_completed, .deferred_free = rcu_tasks_rude_torture_deferred_free, .sync = synchronize_rcu_tasks_rude, .exp_sync = synchronize_rcu_tasks_rude, .call = call_rcu_tasks_rude, .cb_barrier = rcu_barrier_tasks_rude, .fqs = NULL, .stats = NULL, .irq_capable = 1, .name = "tasks-rude" }; static unsigned long rcutorture_seq_diff(unsigned long new, unsigned long old) { if (!cur_ops->gp_diff) Loading @@ -739,7 +766,7 @@ static unsigned long rcutorture_seq_diff(unsigned long new, unsigned long old) static bool __maybe_unused torturing_tasks(void) { return cur_ops == &tasks_ops; return cur_ops == &tasks_ops || cur_ops == &tasks_rude_ops; } /* Loading Loading @@ -2413,7 +2440,7 @@ rcu_torture_init(void) int firsterr = 0; static struct rcu_torture_ops *torture_ops[] = { &rcu_ops, &rcu_busted_ops, &srcu_ops, &srcud_ops, &busted_srcud_ops, &tasks_ops, &trivial_ops, &busted_srcud_ops, &tasks_ops, &tasks_rude_ops, &trivial_ops, }; if (!torture_init_begin(torture_type, verbose)) Loading tools/testing/selftests/rcutorture/configs/rcu/CFLIST +1 −0 Original line number Diff line number Diff line Loading @@ -14,3 +14,4 @@ TINY02 TASKS01 TASKS02 TASKS03 RUDE01 tools/testing/selftests/rcutorture/configs/rcu/RUDE01 0 → 100644 +10 −0 Original line number Diff line number Diff line CONFIG_SMP=y CONFIG_NR_CPUS=2 CONFIG_HOTPLUG_CPU=y CONFIG_PREEMPT_NONE=n CONFIG_PREEMPT_VOLUNTARY=n CONFIG_PREEMPT=y CONFIG_DEBUG_LOCK_ALLOC=y CONFIG_PROVE_LOCKING=y #CHECK#CONFIG_PROVE_RCU=y CONFIG_RCU_EXPERT=y Loading
kernel/rcu/Kconfig.debug +2 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ config RCU_PERF_TEST select TORTURE_TEST select SRCU select TASKS_RCU select TASKS_RUDE_RCU default n help This option provides a kernel module that runs performance Loading @@ -46,6 +47,7 @@ config RCU_TORTURE_TEST select TORTURE_TEST select SRCU select TASKS_RCU select TASKS_RUDE_RCU default n help This option provides a kernel module that runs torture tests Loading
kernel/rcu/rcu.h +1 −0 Original line number Diff line number Diff line Loading @@ -441,6 +441,7 @@ void rcu_request_urgent_qs_task(struct task_struct *t); enum rcutorture_type { RCU_FLAVOR, RCU_TASKS_FLAVOR, RCU_TASKS_RUDE_FLAVOR, RCU_TRIVIAL_FLAVOR, SRCU_FLAVOR, INVALID_RCU_FLAVOR Loading
kernel/rcu/rcutorture.c +29 −2 Original line number Diff line number Diff line Loading @@ -730,6 +730,33 @@ static struct rcu_torture_ops trivial_ops = { .name = "trivial" }; /* * Definitions for rude RCU-tasks torture testing. */ static void rcu_tasks_rude_torture_deferred_free(struct rcu_torture *p) { call_rcu_tasks_rude(&p->rtort_rcu, rcu_torture_cb); } static struct rcu_torture_ops tasks_rude_ops = { .ttype = RCU_TASKS_RUDE_FLAVOR, .init = rcu_sync_torture_init, .readlock = rcu_torture_read_lock_trivial, .read_delay = rcu_read_delay, /* just reuse rcu's version. */ .readunlock = rcu_torture_read_unlock_trivial, .get_gp_seq = rcu_no_completed, .deferred_free = rcu_tasks_rude_torture_deferred_free, .sync = synchronize_rcu_tasks_rude, .exp_sync = synchronize_rcu_tasks_rude, .call = call_rcu_tasks_rude, .cb_barrier = rcu_barrier_tasks_rude, .fqs = NULL, .stats = NULL, .irq_capable = 1, .name = "tasks-rude" }; static unsigned long rcutorture_seq_diff(unsigned long new, unsigned long old) { if (!cur_ops->gp_diff) Loading @@ -739,7 +766,7 @@ static unsigned long rcutorture_seq_diff(unsigned long new, unsigned long old) static bool __maybe_unused torturing_tasks(void) { return cur_ops == &tasks_ops; return cur_ops == &tasks_ops || cur_ops == &tasks_rude_ops; } /* Loading Loading @@ -2413,7 +2440,7 @@ rcu_torture_init(void) int firsterr = 0; static struct rcu_torture_ops *torture_ops[] = { &rcu_ops, &rcu_busted_ops, &srcu_ops, &srcud_ops, &busted_srcud_ops, &tasks_ops, &trivial_ops, &busted_srcud_ops, &tasks_ops, &tasks_rude_ops, &trivial_ops, }; if (!torture_init_begin(torture_type, verbose)) Loading
tools/testing/selftests/rcutorture/configs/rcu/CFLIST +1 −0 Original line number Diff line number Diff line Loading @@ -14,3 +14,4 @@ TINY02 TASKS01 TASKS02 TASKS03 RUDE01
tools/testing/selftests/rcutorture/configs/rcu/RUDE01 0 → 100644 +10 −0 Original line number Diff line number Diff line CONFIG_SMP=y CONFIG_NR_CPUS=2 CONFIG_HOTPLUG_CPU=y CONFIG_PREEMPT_NONE=n CONFIG_PREEMPT_VOLUNTARY=n CONFIG_PREEMPT=y CONFIG_DEBUG_LOCK_ALLOC=y CONFIG_PROVE_LOCKING=y #CHECK#CONFIG_PROVE_RCU=y CONFIG_RCU_EXPERT=y