]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rcutorture: Remove support for SRCU-lite
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 2 Jul 2025 00:23:28 +0000 (17:23 -0700)
committerNeeraj Upadhyay (AMD) <neeraj.upadhyay@kernel.org>
Wed, 16 Jul 2025 04:18:44 +0000 (09:48 +0530)
Because SRCU-lite is being replaced by SRCU-fast, this commit removes
support for SRCU-lite from rcutorture.c

Both SRCU-lite and SRCU-fast provide faster readers by dropping the
smp_mb() call from their lock and unlock primitives, but incur a pair
of added RCU grace periods during the SRCU grace period.  There is a
trivial mapping from the SRCU-lite API to that of SRCU-fast, so there
should be no transition issues.

[ paulmck: Apply Christoph Hellwig feedback. ]

Signed-off-by: "Paul E. McKenney" <paulmck@kernel.org>
Signed-off-by: Neeraj Upadhyay (AMD) <neeraj.upadhyay@kernel.org>
include/linux/srcu.h
kernel/rcu/rcutorture.c

index 900b0d5c05f54704594c30db14335a3f1881c4cb..c20dacb563e55f678e984f6804d7eead12c804f7 100644 (file)
@@ -49,7 +49,7 @@ int init_srcu_struct(struct srcu_struct *ssp);
 #define SRCU_READ_FLAVOR_LITE  0x4             // srcu_read_lock_lite().
 #define SRCU_READ_FLAVOR_FAST  0x8             // srcu_read_lock_fast().
 #define SRCU_READ_FLAVOR_ALL   (SRCU_READ_FLAVOR_NORMAL | SRCU_READ_FLAVOR_NMI | \
-                               SRCU_READ_FLAVOR_LITE | SRCU_READ_FLAVOR_FAST) // All of the above.
+                               SRCU_READ_FLAVOR_FAST) // All of the above.
 #define SRCU_READ_FLAVOR_SLOWGP        (SRCU_READ_FLAVOR_LITE | SRCU_READ_FLAVOR_FAST)
                                                // Flavors requiring synchronize_rcu()
                                                // instead of smp_mb().
index 213f23f20a64b1fe7c8cca22ea7f18c53cf9d92c..7a893d51d02b6afc2142b04309edec2bc05d5073 100644 (file)
@@ -718,11 +718,6 @@ static int srcu_torture_read_lock(void)
                WARN_ON_ONCE(idx & ~0x1);
                ret += idx << 1;
        }
-       if (reader_flavor & SRCU_READ_FLAVOR_LITE) {
-               idx = srcu_read_lock_lite(srcu_ctlp);
-               WARN_ON_ONCE(idx & ~0x1);
-               ret += idx << 2;
-       }
        if (reader_flavor & SRCU_READ_FLAVOR_FAST) {
                scp = srcu_read_lock_fast(srcu_ctlp);
                idx = __srcu_ptr_to_ctr(srcu_ctlp, scp);
@@ -756,8 +751,6 @@ static void srcu_torture_read_unlock(int idx)
        WARN_ON_ONCE((reader_flavor && (idx & ~reader_flavor)) || (!reader_flavor && (idx & ~0x1)));
        if (reader_flavor & SRCU_READ_FLAVOR_FAST)
                srcu_read_unlock_fast(srcu_ctlp, __srcu_ctr_to_ptr(srcu_ctlp, (idx & 0x8) >> 3));
-       if (reader_flavor & SRCU_READ_FLAVOR_LITE)
-               srcu_read_unlock_lite(srcu_ctlp, (idx & 0x4) >> 2);
        if (reader_flavor & SRCU_READ_FLAVOR_NMI)
                srcu_read_unlock_nmisafe(srcu_ctlp, (idx & 0x2) >> 1);
        if ((reader_flavor & SRCU_READ_FLAVOR_NORMAL) || !(reader_flavor & SRCU_READ_FLAVOR_ALL))