diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-03-09 03:47:39 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-03-12 02:41:25 +0300 |
commit | 66c8473135c62f478301a0e5b3012f203562dfa6 (patch) | |
tree | 38552c4bba5b6de12904aa40539c2d14950c17a8 /net | |
parent | d6170e4aaf86424c24ce06e355b4573daa891b17 (diff) | |
download | linux-66c8473135c62f478301a0e5b3012f203562dfa6.tar.xz |
bpf: move sleepable flag from bpf_prog_aux to bpf_prog
prog->aux->sleepable is checked very frequently as part of (some) BPF
program run hot paths. So this extra aux indirection seems wasteful and
on busy systems might cause unnecessary memory cache misses.
Let's move sleepable flag into prog itself to eliminate unnecessary
pointer dereference.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Message-ID: <20240309004739.2961431-1-andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bpf/bpf_dummy_struct_ops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bpf/bpf_dummy_struct_ops.c b/net/bpf/bpf_dummy_struct_ops.c index 1b5f812e6972..de33dc1b0daa 100644 --- a/net/bpf/bpf_dummy_struct_ops.c +++ b/net/bpf/bpf_dummy_struct_ops.c @@ -174,7 +174,7 @@ static int bpf_dummy_ops_check_member(const struct btf_type *t, case offsetof(struct bpf_dummy_ops, test_sleepable): break; default: - if (prog->aux->sleepable) + if (prog->sleepable) return -EINVAL; } |