linux-sg2042/io_uring
Pavel Begunkov 253993210b io_uring: introduce locking helpers for CQE posting
spin_lock(&ctx->completion_lock);
/* post CQEs */
io_commit_cqring(ctx);
spin_unlock(&ctx->completion_lock);
io_cqring_ev_posted(ctx);

We have many places repeating this sequence, and the three function
unlock section is not perfect from the maintainance perspective and also
makes it harder to add new locking/sync trick.

Introduce two helpers. io_cq_lock(), which is simple and only grabs
->completion_lock, and io_cq_unlock_post() encapsulating the three call
section.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/fe0c682bf7f7b55d9be55b0d034be9c1949277dc.1655684496.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-07-24 18:39:14 -06:00
..
Makefile io_uring: move opcode table to opdef.c 2022-07-24 18:39:12 -06:00
advise.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
advise.h io_uring: split out fadvise/madvise operations 2022-07-24 18:39:11 -06:00
cancel.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
cancel.h io_uring: move a few private types to local headers 2022-07-24 18:39:14 -06:00
epoll.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
epoll.h io_uring: move epoll handler to its own file 2022-07-24 18:39:11 -06:00
fdinfo.c io_uring: move a few private types to local headers 2022-07-24 18:39:14 -06:00
fdinfo.h io_uring: move fdinfo helpers to its own file 2022-07-24 18:39:12 -06:00
filetable.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
filetable.h io_uring: make io_uring_types.h public 2022-07-24 18:39:14 -06:00
fs.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
fs.h io_uring: split out filesystem related operations 2022-07-24 18:39:11 -06:00
io-wq.c io_uring: move to separate directory 2022-07-24 18:39:10 -06:00
io-wq.h io_uring: make io_uring_types.h public 2022-07-24 18:39:14 -06:00
io_uring.c io_uring: introduce locking helpers for CQE posting 2022-07-24 18:39:14 -06:00
io_uring.h io_uring: introduce locking helpers for CQE posting 2022-07-24 18:39:14 -06:00
kbuf.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
kbuf.h io_uring: don't inline io_put_kbuf 2022-07-24 18:39:13 -06:00
msg_ring.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
msg_ring.h io_uring: move msg_ring into its own file 2022-07-24 18:39:12 -06:00
net.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
net.h io_uring: split network related opcodes into its own file 2022-07-24 18:39:11 -06:00
nop.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
nop.h io_uring: move nop into its own file 2022-07-24 18:39:11 -06:00
opdef.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
opdef.h io_uring: move opcode table to opdef.c 2022-07-24 18:39:12 -06:00
openclose.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
openclose.h io_uring: split out open/close operations 2022-07-24 18:39:11 -06:00
poll.c io_uring: fix io_poll_remove_all clang warnings 2022-07-24 18:39:14 -06:00
poll.h io_uring: move a few private types to local headers 2022-07-24 18:39:14 -06:00
refs.h io_uring: make io_uring_types.h public 2022-07-24 18:39:14 -06:00
rsrc.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
rsrc.h io_uring: move a few private types to local headers 2022-07-24 18:39:14 -06:00
rw.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
rw.h io_uring: move read/write related opcodes to its own file 2022-07-24 18:39:12 -06:00
splice.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
splice.h io_uring: split out splice related operations 2022-07-24 18:39:11 -06:00
sqpoll.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
sqpoll.h io_uring: move SQPOLL related handling into its own file 2022-07-24 18:39:12 -06:00
statx.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
statx.h io_uring: move statx handling to its own file 2022-07-24 18:39:11 -06:00
sync.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
sync.h io_uring: split out fs related sync/fallocate functions 2022-07-24 18:39:11 -06:00
tctx.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
tctx.h io_uring: add IORING_SETUP_SINGLE_ISSUER 2022-07-24 18:39:13 -06:00
timeout.c io_uring: introduce locking helpers for CQE posting 2022-07-24 18:39:14 -06:00
timeout.h io_uring: move a few private types to local headers 2022-07-24 18:39:14 -06:00
uring_cmd.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
uring_cmd.h io_uring: move uring_cmd handling to its own file 2022-07-24 18:39:11 -06:00
xattr.c io_uring: kill extra io_uring_types.h includes 2022-07-24 18:39:14 -06:00
xattr.h io_uring: move xattr related opcodes to its own file 2022-07-24 18:39:11 -06:00