]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit788b05f6311bc288f8845c316eaa661b5e8d7f31
treef702d851a561f1dd744c0b501c13ebfa5412e618
parentb358a0e3aa50c45b2d00f5a8d467ff145bac8ba2
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