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>
Tue, 10 Aug 2021 19:52:05 +0000 (13:52 -0600)
commit27cc8c0c1ab7f4e1a581fc6b78f873a9032a55e3
treecc505a6894a498e763eb4cca0c0c2c882fd2af6a
parent5d92eb40c9f84fb0f0fd5b4135cae00e9c67a89a
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