io_uring: replace smp_mb() with smp_mb__after_atomic() in io_sq_thread()
PATCH 1/1 io_uring: replace smp_mb() with smp_mb__after_atomic() in io_sq_thread()
The IORING_SQ_NEED_WAKEUP flag is now set using atomic_or() which implies a full barrier on some architectures but it is not required to do so. Use the more appropriate smp_mb__after_atomic() which avoids the extra barrier on those architectures.
Signed-off-by Almog Khaikin <[email protected]>
--- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
@@ -8229,7 +8229,7 @@ static int io_sq_thread(void *data)* Ensure the store of the wakeup flag is not * reordered with the load of the SQ tail */ -smp_mb (); +smp_mb__after_atomic ();if (io_sqring_entries (ctx)) { needs_sched = false;
base-commit: 6f07a54a90ee98ae13b37ac358624d7cc7e57850
Signature · 1 line
2.36.0
Quoted 6 lines · Almog Khaikin
The
IORING_SQ_NEED_WAKEUPflag is now set usingatomic_or()which implies a full barrier on some architectures but it is not required to do so. Use the more appropriatesmp_mb__after_atomic()which avoids the extra barrier on those architectures.
Applied, thanks!
[1/1] io_uring: replace smp_mb() with smp_mb__after_atomic() in io_sq_thread()
commit: 012b7e911e69791ea518ef3d084c12cb2b8f2914
Best regards,
Signature · 1 line
Jens Axboe