diff options
Diffstat (limited to 'kernel/rcu')
-rw-r--r-- | kernel/rcu/rcutorture.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 178716713e11..75b1abf78c48 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c | |||
@@ -601,6 +601,52 @@ static struct rcu_torture_ops sched_ops = { | |||
601 | .name = "sched" | 601 | .name = "sched" |
602 | }; | 602 | }; |
603 | 603 | ||
604 | #ifdef CONFIG_TASKS_RCU | ||
605 | |||
606 | /* | ||
607 | * Definitions for RCU-tasks torture testing. | ||
608 | */ | ||
609 | |||
610 | static int tasks_torture_read_lock(void) | ||
611 | { | ||
612 | return 0; | ||
613 | } | ||
614 | |||
615 | static void tasks_torture_read_unlock(int idx) | ||
616 | { | ||
617 | } | ||
618 | |||
619 | static void rcu_tasks_torture_deferred_free(struct rcu_torture *p) | ||
620 | { | ||
621 | call_rcu_tasks(&p->rtort_rcu, rcu_torture_cb); | ||
622 | } | ||
623 | |||
624 | static struct rcu_torture_ops tasks_ops = { | ||
625 | .ttype = RCU_TASKS_FLAVOR, | ||
626 | .init = rcu_sync_torture_init, | ||
627 | .readlock = tasks_torture_read_lock, | ||
628 | .read_delay = rcu_read_delay, /* just reuse rcu's version. */ | ||
629 | .readunlock = tasks_torture_read_unlock, | ||
630 | .completed = rcu_no_completed, | ||
631 | .deferred_free = rcu_tasks_torture_deferred_free, | ||
632 | .sync = synchronize_rcu_tasks, | ||
633 | .exp_sync = synchronize_rcu_tasks, | ||
634 | .call = call_rcu_tasks, | ||
635 | .cb_barrier = rcu_barrier_tasks, | ||
636 | .fqs = NULL, | ||
637 | .stats = NULL, | ||
638 | .irq_capable = 1, | ||
639 | .name = "tasks" | ||
640 | }; | ||
641 | |||
642 | #define RCUTORTURE_TASKS_OPS &tasks_ops, | ||
643 | |||
644 | #else /* #ifdef CONFIG_TASKS_RCU */ | ||
645 | |||
646 | #define RCUTORTURE_TASKS_OPS | ||
647 | |||
648 | #endif /* #else #ifdef CONFIG_TASKS_RCU */ | ||
649 | |||
604 | /* | 650 | /* |
605 | * RCU torture priority-boost testing. Runs one real-time thread per | 651 | * RCU torture priority-boost testing. Runs one real-time thread per |
606 | * CPU for moderate bursts, repeatedly registering RCU callbacks and | 652 | * CPU for moderate bursts, repeatedly registering RCU callbacks and |
@@ -1295,7 +1341,8 @@ static int rcu_torture_barrier_cbs(void *arg) | |||
1295 | if (atomic_dec_and_test(&barrier_cbs_count)) | 1341 | if (atomic_dec_and_test(&barrier_cbs_count)) |
1296 | wake_up(&barrier_wq); | 1342 | wake_up(&barrier_wq); |
1297 | } while (!torture_must_stop()); | 1343 | } while (!torture_must_stop()); |
1298 | cur_ops->cb_barrier(); | 1344 | if (cur_ops->cb_barrier != NULL) |
1345 | cur_ops->cb_barrier(); | ||
1299 | destroy_rcu_head_on_stack(&rcu); | 1346 | destroy_rcu_head_on_stack(&rcu); |
1300 | torture_kthread_stopping("rcu_torture_barrier_cbs"); | 1347 | torture_kthread_stopping("rcu_torture_barrier_cbs"); |
1301 | return 0; | 1348 | return 0; |
@@ -1534,6 +1581,7 @@ rcu_torture_init(void) | |||
1534 | int firsterr = 0; | 1581 | int firsterr = 0; |
1535 | static struct rcu_torture_ops *torture_ops[] = { | 1582 | static struct rcu_torture_ops *torture_ops[] = { |
1536 | &rcu_ops, &rcu_bh_ops, &rcu_busted_ops, &srcu_ops, &sched_ops, | 1583 | &rcu_ops, &rcu_bh_ops, &rcu_busted_ops, &srcu_ops, &sched_ops, |
1584 | RCUTORTURE_TASKS_OPS | ||
1537 | }; | 1585 | }; |
1538 | 1586 | ||
1539 | if (!torture_init_begin(torture_type, verbose, &rcutorture_runnable)) | 1587 | if (!torture_init_begin(torture_type, verbose, &rcutorture_runnable)) |