io_uring/rsrc: add last-lookup cache hit to io_rsrc_node_lookup() io_uring-rsrc.2
authorJens Axboe <axboe@kernel.dk>
Sun, 27 Oct 2024 15:19:51 +0000 (09:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 28 Oct 2024 14:49:44 +0000 (08:49 -0600)
commitb90eed6726408cb96b8a427b06bf2215f66505d9
treebce29b7cb38ec1fd75ae00f65101ac03c90f3abf
parent3357a7a766f61c9ce74659a3e5e59a74f5a67beb
io_uring/rsrc: add last-lookup cache hit to io_rsrc_node_lookup()

This avoids array_index_nospec() for repeated lookups on the same node,
which can be quite common (and costly). When the node sees its last
put, it'll clear the cache as well.

Note: need to double check this is 100% safe wrt speculation, but I
believe it should be as we're not using the passed in value to index
any arrays (directly).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/filetable.c
io_uring/rsrc.c
io_uring/rsrc.h