* [PATCH] io_uring: replace smp_mb() with smp_mb__after_atomic() in io_sq_thread()
@ 2022-04-26 16:34 Almog Khaikin
2022-04-26 17:04 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Almog Khaikin @ 2022-04-26 16:34 UTC (permalink / raw)
To: axboe; +Cc: io-uring
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(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 72cb2d50125c..1e7466079af7 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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
--
2.36.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-26 17:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-26 16:34 [PATCH] io_uring: replace smp_mb() with smp_mb__after_atomic() in io_sq_thread() Almog Khaikin
2022-04-26 17:04 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox