io_uring: drain based on allocates reqs
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 9 May 2025 11:12:54 +0000 (12:12 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 12 May 2025 13:52:52 +0000 (07:52 -0600)
commit8fb7aee05591fd4d3dca1460448a59e95fa821c3
treee8bc51a80fee546a04799a688b94495a9dae079d
parent63de899cb6220357dea9d0f4e5aa459ff5193bb0
io_uring: drain based on allocates reqs

Don't rely on CQ sequence numbers for draining, as it has become messy
and needs cq_extra adjustments. Instead, base it on the number of
allocated requests and only allow flushing when all requests are in the
drain list.

As a result, cq_extra is gone, no overhead for its accounting in aux cqe
posting, less bloating as it was inlined before, and it's in general
simpler than trying to track where we should bump it and where it should
be put back like in cases of overflow. Also, it'll likely help with
cleaning and unifying some of the CQ posting helpers.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/46ece1e34320b046c06fee2498d6b4cd12a700f2.1746788718.git.asml.silence@gmail.com
Link: https://lore.kernel.org/r/24497b04b004bceada496033d3c9d09ff8e81ae9.1746944903.git.asml.silence@gmail.com
[axboe: fold in fix from link2]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/io_uring.c
io_uring/io_uring.h