SUNRPC: Remove unnecessary memory barriers
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 12 Jul 2021 16:24:15 +0000 (12:24 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Oct 2021 00:49:05 +0000 (20:49 -0400)
The only check for RPC_TASK_RUNNING is the one in rpc_make_runnable(),
which happens under the same spin lock held when we call
rpc_clear_running().

Ditto, the last check for RPC_TASK_QUEUED in rpc_execute() is performed
under the same lock as the one held when we call rpc_clear_queued().

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
include/linux/sunrpc/sched.h

index a237b8dbf6086bd717d94f29d84ce610dd8d97cd..db964bb6391247e79e3aeff602a3084c74d56e00 100644 (file)
@@ -150,25 +150,13 @@ struct rpc_task_setup {
 #define RPC_TASK_MSG_PIN_WAIT  5
 #define RPC_TASK_SIGNALLED     6
 
-#define RPC_IS_RUNNING(t)      test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
-#define rpc_set_running(t)     set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
 #define rpc_test_and_set_running(t) \
                                test_and_set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
-#define rpc_clear_running(t)   \
-       do { \
-               smp_mb__before_atomic(); \
-               clear_bit(RPC_TASK_RUNNING, &(t)->tk_runstate); \
-               smp_mb__after_atomic(); \
-       } while (0)
+#define rpc_clear_running(t)   clear_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
 
 #define RPC_IS_QUEUED(t)       test_bit(RPC_TASK_QUEUED, &(t)->tk_runstate)
 #define rpc_set_queued(t)      set_bit(RPC_TASK_QUEUED, &(t)->tk_runstate)
-#define rpc_clear_queued(t)    \
-       do { \
-               smp_mb__before_atomic(); \
-               clear_bit(RPC_TASK_QUEUED, &(t)->tk_runstate); \
-               smp_mb__after_atomic(); \
-       } while (0)
+#define rpc_clear_queued(t)    clear_bit(RPC_TASK_QUEUED, &(t)->tk_runstate)
 
 #define RPC_IS_ACTIVATED(t)    test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate)