io_uring: tweak iopoll CQE_SKIP event counting
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 5 Dec 2021 14:37:59 +0000 (14:37 +0000)
committerJens Axboe <axboe@kernel.dk>
Sun, 5 Dec 2021 15:56:24 +0000 (08:56 -0700)
commit83a13a4181b0e874d1f196e11b953c3c9f009f68
treec6eb8a2c2375cf75ba4937d712d625878e61c04b
parentd1fd1c201d750711e17377acb4914d3ea29a608c
io_uring: tweak iopoll CQE_SKIP event counting

When iopolling the userspace specifies the minimum number of "events" it
expects. Previously, we had one CQE per request, so the definition of
an "event" was unequivocal, but that's not more the case anymore with
REQ_F_CQE_SKIP.

Currently it counts the number of completed requests, replace it with
the number of posted CQEs. This allows users of the "one CQE per link"
scheme to wait for all N links in a single syscall, which is not
possible without the patch and requires extra context switches.

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