-
Notifications
You must be signed in to change notification settings - Fork 498
Closed
Description
@axboe, The man page for io_uring_setup.2 recently added the rationale for using memory load acquire semantics when checking sq_ring->flags:
/*
* Ensure that the wakeup flag is read after the tail pointer
* has been written. It's important to use memory load acquire
* semantics for the flags read, as otherwise the application
* and the kernel might not agree on the consistency of the
* wakeup flag.
*/
unsigned flags = atomic_load_relaxed(sq_ring->flags);
However, looking closer, just after the comment, the actual semantics being used in the example above are atomic_load_relaxed instead of atomic_load_acquire?
The same might also be the case in queue.c for the implementation of sq_ring_needs_enter(), which uses IO_URING_READ_ONCE(*ring->sq.kflags).
To avoid I/O starvation, maybe a stronger barrier such as acquire is needed here instead of relaxed?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels