The patch titled rcu: refactor srcu_torture_deferred_free to work for any implementation has been added to the -mm tree. Its filename is rcu-refactor-srcu_torture_deferred_free-to-work-for.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: rcu: refactor srcu_torture_deferred_free to work for any implementation From: Josh Triplett <josht@xxxxxxxxxx> Make srcu_torture_deferred_free use cur_ops->sync() so it will work for any implementation. Move and rename it in preparation for use in the ops of other implementations. Signed-off-by: Josh Triplett <josh@xxxxxxxxxxxxxxx> Acked-by: Paul E. McKenney <paulmck@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- kernel/rcutorture.c | 53 ++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff -puN kernel/rcutorture.c~rcu-refactor-srcu_torture_deferred_free-to-work-for kernel/rcutorture.c --- a/kernel/rcutorture.c~rcu-refactor-srcu_torture_deferred_free-to-work-for +++ a/kernel/rcutorture.c @@ -117,6 +117,7 @@ static atomic_t n_rcu_torture_alloc_fail static atomic_t n_rcu_torture_free; static atomic_t n_rcu_torture_mberror; static atomic_t n_rcu_torture_error; +static struct list_head rcu_torture_removed; /* * Allocate an element from the rcu_tortures pool. @@ -270,6 +271,32 @@ static struct rcu_torture_ops rcu_ops = .name = "rcu" }; +static void rcu_sync_torture_deferred_free(struct rcu_torture *p) +{ + int i; + struct rcu_torture *rp; + struct rcu_torture *rp1; + + cur_ops->sync(); + list_add(&p->rtort_free, &rcu_torture_removed); + list_for_each_entry_safe(rp, rp1, &rcu_torture_removed, rtort_free) { + i = rp->rtort_pipe_count; + if (i > RCU_TORTURE_PIPE_LEN) + i = RCU_TORTURE_PIPE_LEN; + atomic_inc(&rcu_torture_wcount[i]); + if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) { + rp->rtort_mbtest = 0; + list_del(&rp->rtort_free); + rcu_torture_free(rp); + } + } +} + +static void rcu_sync_torture_init(void) +{ + INIT_LIST_HEAD(&rcu_torture_removed); +} + /* * Definitions for rcu_bh torture testing. */ @@ -335,12 +362,11 @@ static struct rcu_torture_ops rcu_bh_ops */ static struct srcu_struct srcu_ctl; -static struct list_head srcu_removed; static void srcu_torture_init(void) { init_srcu_struct(&srcu_ctl); - INIT_LIST_HEAD(&srcu_removed); + rcu_sync_torture_init(); } static void srcu_torture_cleanup(void) @@ -377,27 +403,6 @@ static int srcu_torture_completed(void) return srcu_batches_completed(&srcu_ctl); } -static void srcu_torture_deferred_free(struct rcu_torture *p) -{ - int i; - struct rcu_torture *rp; - struct rcu_torture *rp1; - - synchronize_srcu(&srcu_ctl); - list_add(&p->rtort_free, &srcu_removed); - list_for_each_entry_safe(rp, rp1, &srcu_removed, rtort_free) { - i = rp->rtort_pipe_count; - if (i > RCU_TORTURE_PIPE_LEN) - i = RCU_TORTURE_PIPE_LEN; - atomic_inc(&rcu_torture_wcount[i]); - if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) { - rp->rtort_mbtest = 0; - list_del(&rp->rtort_free); - rcu_torture_free(rp); - } - } -} - static void srcu_torture_synchronize(void) { synchronize_srcu(&srcu_ctl); @@ -427,7 +432,7 @@ static struct rcu_torture_ops srcu_ops = .readdelay = srcu_read_delay, .readunlock = srcu_torture_read_unlock, .completed = srcu_torture_completed, - .deferredfree = srcu_torture_deferred_free, + .deferredfree = rcu_sync_torture_deferred_free, .sync = srcu_torture_synchronize, .stats = srcu_torture_stats, .name = "srcu" _ Patches currently in -mm which might be from josht@xxxxxxxxxx are xfs-add-lock-annotations-to-xfs_trans_update_ail-and-xfs_trans_delete_ail.patch mtrr-add-lock-annotations-for-prepare_set-and.patch efi-add-lock-annotations-for-efi_call_phys_prelog-and-efi_call_phys_epilog.patch mbcache-add-lock-annotation-for-__mb_cache_entry_release_unlock.patch afs-add-lock-annotations-to-afs_proc_cell_servers_startstop.patch fuse-add-lock-annotations-to-request_end-and-fuse_read_interrupt.patch hugetlbfs-add-lock-annotation-to-hugetlbfs_forget_inode.patch jbd-add-lock-annotation-to-jbd_sync_bh.patch fs-add-lock-annotation-to-grab_super.patch rcu-add-lock-annotations-to-rcu_bh_torture_read_lockunlock.patch timer-add-lock-annotation-to-lock_timer_base.patch make-spinlock-rwlock-annotations-more-accurate-by-using.patch replace-_spin_trylock-with-spin_trylock-in-the-irq.patch pass-a-lock-expression-to-__cond_lock-like-__acquire-and.patch pass-sparse-the-lock-expression-given-to-lock-annotations.patch nfsd-add-lock-annotations-to-e_start-and-e_stop.patch srcu-3-rcu-variant-permitting-read-side-blocking-srcu-add-lock-annotations.patch rcu-add-module_author-to-rcutorture-module.patch rcu-fix-incorrect-description-of-default-for-rcutorture.patch rcu-mention-rcu_bh-in-description-of-rcutortures.patch rcu-avoid-kthread_stop-on-invalid-pointer-if-rcutorture.patch rcu-fix-sign-bug-making-rcu_random-always-return-the-same.patch rcu-add-fake-writers-to-rcutorture.patch rcu-add-fake-writers-to-rcutorture-tidy.patch rcu-refactor-srcu_torture_deferred_free-to-work-for.patch rcu-add-rcu_sync-torture-type-to-rcutorture.patch rcu-add-rcu_bh_sync-torture-type-to-rcutorture.patch rcu-add-sched-torture-type-to-rcutorture.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html