]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
io_uring/bpf_filter: cache lookup table in ctx->bpf_filters
authorJens Axboe <axboe@kernel.dk>
Sat, 17 Jan 2026 15:27:23 +0000 (08:27 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 27 Jan 2026 18:10:46 +0000 (11:10 -0700)
commite7c30675a7fb79d94400987865a3bd620458ca1a
tree59e7c274e821fc3f683702d96ed07bf73de96140
parent8768770cf5d76d177fa2200e6957a372e61e06b5
io_uring/bpf_filter: cache lookup table in ctx->bpf_filters

Currently a few pointer dereferences need to be made to both check if
BPF filters are installed, and then also to retrieve the actual filter
for the opcode. Cache the table in ctx->bpf_filters to avoid that.

Add a bit of debug info on ring exit to show if we ever got this wrong.
Small risk of that given that the table is currently only updated in one
spot, but once task forking is enabled, that will add one more spot.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/bpf_filter.c
io_uring/bpf_filter.h
io_uring/io_uring.c
io_uring/register.c