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, 9 Aug 2021 15:05:44 +0000 (09:05 -0600)
commit911cd0d3e16d37882df2fa223ec906e7e616f60a
tree186f2f0244e1619654d2cb10b708deb16ce4e2fd
parentb26d1744f1efd78d137e732bbe4eef4ebb098071
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