diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-12-07 08:50:01 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-12-07 08:51:08 -0700 |
commit | f66f73421f0a929734bb41dde575e6d7859e548f (patch) | |
tree | 51e49f7b56ce259e8dc755471e3359549774b7c7 /io_uring/msg_ring.c | |
parent | 6d043ee1164ca3305738131f170e560587070fa9 (diff) |
io_uring: skip spinlocking for ->task_complete
->task_complete was added to serialised CQE posting by doing it from
the task context only (or fallback wq when the task is dead), and now we
can use that to avoid taking ->completion_lock while filling CQ entries.
The patch skips spinlocking only in two spots,
__io_submit_flush_completions() and flushing in io_aux_cqe, it's safer
and covers all cases we care about. Extra care is taken to force taking
the lock while queueing overflow entries.
It fundamentally relies on SINGLE_ISSUER to have only one task posting
events. It also need to take into account overflowed CQEs, flushing of
which happens in the cq wait path, and so this implementation also needs
DEFER_TASKRUN to limit waiters. For the same reason we disable it for
SQPOLL, and for IOPOLL as it won't benefit from it in any case.
DEFER_TASKRUN, SQPOLL and IOPOLL requirement may be relaxed in the
future.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/2a8c91fd82cfcdcc1d2e5bac7051fe2c183bda73.1670384893.git.asml.silence@gmail.com
[axboe: modify to apply]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/msg_ring.c')
0 files changed, 0 insertions, 0 deletions