io_uring: manage provided buffers strictly ordered
authorJens Axboe <axboe@kernel.dk>
Thu, 17 Mar 2022 23:20:10 +0000 (17:20 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Mar 2022 23:20:10 +0000 (17:20 -0600)
commitdbc7d452e7cf7d3ebc0064e68d30e28d86d3939a
tree611c0d0e81edb1e383932e9ce53148aa22a038e6
parent9aa8dfde4869ccdec0a7290b686dbc10e079e163
io_uring: manage provided buffers strictly ordered

Workloads using provided buffers benefit from using and returning buffers
in the right order, and so does TLBs for that matter. Manage the internal
buffer list in a straight list, rather than use the head buffer as the
insertion node. Use a hashed list for the buffer group IDs instead of
xarray, the overhead is much lower this way. xarray provides internal
locking and other trickery that is handy for some uses cases, but
io_uring already locks internally for the buffer manipulation and needs
none of that.

This is good for about a 2% reduction in overhead, combination of the
improved management and the fact that the workload has an easier time
bundling back provided buffers.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c