Skip to content

Commit 904ebd2

Browse files
Muchun Songaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Chengming Zhou <[email protected]> Reviewed-by: Omar Sandoval <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent fdad1a2 commit 904ebd2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

block/blk-rq-qos.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ static int rq_qos_wake_function(struct wait_queue_entry *curr,
218218
return -1;
219219

220220
data->got_token = true;
221-
smp_wmb();
222221
wake_up_process(data->task);
223222
list_del_init_careful(&curr->entry);
224223
return 1;
@@ -274,10 +273,9 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data,
274273
* which means we now have two. Put our local token
275274
* and wake anyone else potentially waiting for one.
276275
*/
277-
smp_rmb();
278276
if (data.got_token)
279277
cleanup_cb(rqw, private_data);
280-
break;
278+
return;
281279
}
282280
io_schedule();
283281
has_sleeper = true;

0 commit comments

Comments
 (0)