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 23:51:15 +0000 (17:51 -0600)
commit5133a6714e1254dfe0a9498be2e50f950f39108e
tree4d27f6b25861d35f7d03cca5f69168a5e376be8b
parent36ac281018ff2c88e288b69bfb73e2a23efd9737
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