]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/rcu/rcutorture.c
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[karo-tx-linux.git] / kernel / rcu / rcutorture.c
index 9cbb8a7b909d18a36fe78e793bfab51c63c0b4c8..ae6e574d4cf5c3fbdd8ab9a56009981cec9935a1 100644 (file)
@@ -562,18 +562,31 @@ static void srcu_torture_stats(void)
        int __maybe_unused cpu;
        int idx;
 
+#if defined(CONFIG_TREE_SRCU) || defined(CONFIG_CLASSIC_SRCU)
 #ifdef CONFIG_TREE_SRCU
+       idx = srcu_ctlp->srcu_idx & 0x1;
+#else /* #ifdef CONFIG_TREE_SRCU */
        idx = srcu_ctlp->completed & 0x1;
+#endif /* #else #ifdef CONFIG_TREE_SRCU */
        pr_alert("%s%s Tree SRCU per-CPU(idx=%d):",
                 torture_type, TORTURE_FLAG, idx);
        for_each_possible_cpu(cpu) {
                unsigned long l0, l1;
                unsigned long u0, u1;
                long c0, c1;
-               struct srcu_array *counts = per_cpu_ptr(srcu_ctlp->per_cpu_ref, cpu);
+#ifdef CONFIG_TREE_SRCU
+               struct srcu_data *counts;
+
+               counts = per_cpu_ptr(srcu_ctlp->sda, cpu);
+               u0 = counts->srcu_unlock_count[!idx];
+               u1 = counts->srcu_unlock_count[idx];
+#else /* #ifdef CONFIG_TREE_SRCU */
+               struct srcu_array *counts;
 
+               counts = per_cpu_ptr(srcu_ctlp->per_cpu_ref, cpu);
                u0 = counts->unlock_count[!idx];
                u1 = counts->unlock_count[idx];
+#endif /* #else #ifdef CONFIG_TREE_SRCU */
 
                /*
                 * Make sure that a lock is always counted if the corresponding
@@ -581,8 +594,13 @@ static void srcu_torture_stats(void)
                 */
                smp_rmb();
 
+#ifdef CONFIG_TREE_SRCU
+               l0 = counts->srcu_lock_count[!idx];
+               l1 = counts->srcu_lock_count[idx];
+#else /* #ifdef CONFIG_TREE_SRCU */
                l0 = counts->lock_count[!idx];
                l1 = counts->lock_count[idx];
+#endif /* #else #ifdef CONFIG_TREE_SRCU */
 
                c0 = l0 - u0;
                c1 = l1 - u1;
@@ -1342,12 +1360,14 @@ rcu_torture_stats_print(void)
                cur_ops->stats();
        if (rtcv_snap == rcu_torture_current_version &&
            rcu_torture_current != NULL) {
-               int __maybe_unused flags;
-               unsigned long __maybe_unused gpnum;
-               unsigned long __maybe_unused completed;
+               int __maybe_unused flags = 0;
+               unsigned long __maybe_unused gpnum = 0;
+               unsigned long __maybe_unused completed = 0;
 
                rcutorture_get_gp_data(cur_ops->ttype,
                                       &flags, &gpnum, &completed);
+               srcutorture_get_gp_data(cur_ops->ttype, srcu_ctlp,
+                                       &flags, &gpnum, &completed);
                wtp = READ_ONCE(writer_task);
                pr_alert("??? Writer stall state %s(%d) g%lu c%lu f%#x ->state %#lx\n",
                         rcu_torture_writer_state_getname(),