summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuchun Song <songmuchun@bytedance.com>2024-10-21 10:52:51 +0200
committerJens Axboe <axboe@kernel.dk>2024-10-22 22:05:09 +0200
commit904ebd2527c507752f5ddb358f887d2e0dab96a0 (patch)
treef4cd4b31081fec8d39137824defffcfd50ca5dcb
parentMerge branch 'for-6.13/block-atomic' into for-6.13/block (diff)
downloadlinux-904ebd2527c507752f5ddb358f887d2e0dab96a0.tar.xz
linux-904ebd2527c507752f5ddb358f887d2e0dab96a0.zip
block: remove redundant explicit memory barrier from rq_qos waiter and waker
The memory barriers in list_del_init_careful() and list_empty_careful() in pairs already handle the proper ordering between data.got_token and data.wq.entry. So remove the redundant explicit barriers. And also change a "break" statement to "return" to avoid redundant calling of finish_wait(). Signed-off-by: Muchun Song <songmuchun@bytedance.com> Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev> Reviewed-by: Omar Sandoval <osandov@fb.com> Link: https://lore.kernel.org/r/20241021085251.73353-1-songmuchun@bytedance.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-rq-qos.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c
index 058f92c4f9d5..eb9618cd68ad 100644
--- a/block/blk-rq-qos.c
+++ b/block/blk-rq-qos.c
@@ -218,7 +218,6 @@ static int rq_qos_wake_function(struct wait_queue_entry *curr,
return -1;
data->got_token = true;
- smp_wmb();
wake_up_process(data->task);
list_del_init_careful(&curr->entry);
return 1;
@@ -274,10 +273,9 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data,
* which means we now have two. Put our local token
* and wake anyone else potentially waiting for one.
*/
- smp_rmb();
if (data.got_token)
cleanup_cb(rqw, private_data);
- break;
+ return;
}
io_schedule();
has_sleeper = true;