io_uring: use kvmalloc for fixed files
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 9 Aug 2021 12:04:01 +0000 (13:04 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Aug 2021 19:07:56 +0000 (13:07 -0600)
commit042b0d85eabb79909ef29063fb45d363cbc0a85d
tree4645d36bd68c9ca14fe2ce33863b96e880f62983
parent5fd4617840596884334332f36cabfe0deabe85c8
io_uring: use kvmalloc for fixed files

Instead of hand-coded two-level tables for registered files, allocate
them with kvmalloc(). In many cases small enough tables are enough, and
so can be kmalloc()'ed removing an extra memory load and a bunch of bit
logic instructions from the hot path. If the table is larger, we trade
off all the pros with a TLB-assisted memory lookup.

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