io_uring: get rid of hashed provided buffer groups
authorJens Axboe <axboe@kernel.dk>
Sun, 1 May 2022 16:52:44 +0000 (10:52 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 May 2022 12:29:06 +0000 (06:29 -0600)
commit9cfc7e94e42be9c73072606b84d4574a0a2ec270
treef702d851a561f1dd744c0b501c13ebfa5412e618
parent4e9067025259d1227c7f4f18a02c166c93e49290
io_uring: get rid of hashed provided buffer groups

Use a plain array for any group ID that's less than 64, and punt
anything beyond that to an xarray. 64 fits in a page even for 4KB
page sizes and with the planned additions.

This makes the expected group usage faster by avoiding a hash and lookup
to find our list, and it uses less memory upfront by not allocating any
memory for provided buffers unless it's actually being used.

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