]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
srcu: Remove smp_mb() from srcu_read_unlock_lite()
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 11 Nov 2024 17:38:26 +0000 (09:38 -0800)
committerFrederic Weisbecker <frederic@kernel.org>
Tue, 12 Nov 2024 22:30:33 +0000 (23:30 +0100)
The srcu_read_unlock_lite() function invokes __srcu_read_unlock() instead
of __srcu_read_unlock_lite(), which means that it is doing an unnecessary
smp_mb().  This is harmless other than the performance degradation.

This commit therefore switches to __srcu_read_unlock_lite().

Reported-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
Closes: https://lore.kernel.org/all/d07e8f4a-d5ff-4c8e-8e61-50db285c57e9@amd.com/
Fixes: c0f08d6b5a61 ("srcu: Add srcu_read_lock_lite() and srcu_read_unlock_lite()")
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
include/linux/srcu.h

index bab1dae3f69e636c322a21e47fbd0bee7f6f18a3..56f83237de4d46fc1052bef9b855fe563d8a0408 100644 (file)
@@ -372,7 +372,7 @@ static inline void srcu_read_unlock_lite(struct srcu_struct *ssp, int idx)
        WARN_ON_ONCE(idx & ~0x1);
        srcu_check_read_flavor(ssp, SRCU_READ_FLAVOR_LITE);
        srcu_lock_release(&ssp->dep_map);
-       __srcu_read_unlock(ssp, idx);
+       __srcu_read_unlock_lite(ssp, idx);
 }
 
 /**