io_uring/rsrc: add last-lookup cache hit to io_rsrc_node_lookup() io_uring-rsrc.1
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 13:07:56 +0000 (07:07 -0600)
commitd025ad318273abaa6e59c7f908a225c03793125c
tree3ed8ddb4f88067da736cc1571da0f8f9498d9cc7
parentc36b1853871d71fa6eee67aec1dfe3ca36df9cb3
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 values (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