]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring/notif: order notif vs send CQEs
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 24 Aug 2022 12:07:41 +0000 (13:07 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 24 Aug 2022 14:57:28 +0000 (08:57 -0600)
commitba41912e1efb0d5e8ac1a199147951c2d9444f4b
tree9f3c2b3ecf2c84631b305b29328e348ef61fbbb2
parent4bb83fd3fe0419bd1693a4d9ad37a7188c3fdaa0
io_uring/notif: order notif vs send CQEs

Currently, there is no ordering between notification CQEs and
completions of the send flushing it, this quite complicates the
userspace, especially since we don't flush notification when the
send(+flush) request fails, i.e. there will be only one CQE. What we
can do is to make sure that notification completions come only after
sends.

The easiest way to achieve this is to not try to complete a notification
inline from io_sendzc() but defer it to task_work, considering that
io-wq sendzc is disallowed CQEs will be naturally ordered because
task_works will only be executed after we're done with submission and so
inline completion.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/cddfd1c2bf91f22b9fe08e13b7dffdd8f858a151.1661342812.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/notif.c