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>
 
                return -1;
 
        data->got_token = true;
-       smp_wmb();
        wake_up_process(data->task);
        list_del_init_careful(&curr->entry);
        return 1;
                         * 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;