io_uring: remove file batch-get optimisation
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 10 Aug 2021 13:52:47 +0000 (14:52 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Aug 2021 19:10:32 +0000 (13:10 -0600)
commit62906e89e63ba497105c0e3558089a10365f4f33
treee46cdd68fd6c6e57479134ec37e6c02c3b62e6f7
parent6294f3686b4d77771ab8b161304ada546e71d36a
io_uring: remove file batch-get optimisation

For requests with non-fixed files, instead of grabbing just one
reference, we get by the number of left requests, so the following
requests using the same file can take it without atomics.

However, it's not all win. If there is one request in the middle
not using files or having a fixed file, we'll need to put back the left
references. Even worse if an application submits requests dealing with
different files, it will do a put for each new request, so doubling the
number of atomics needed. Also, even if not used, it's still takes some
cycles in the submission path.

If a file used many times, it rather makes sense to pre-register it, if
not, we may fall in the described pitfall. So, this optimisation is a
matter of use case. Go with the simpliest code-wise way, remove it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c