diff options
author | Alexei Starovoitov <ast@kernel.org> | 2021-02-10 06:36:26 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2021-02-11 18:17:50 +0300 |
commit | 700d4796ef59f5faf240d307839bd419e2b6bdff (patch) | |
tree | dc3d98f6691576479f2b727ce0d9ce7726b33ad7 /kernel/bpf/trampoline.c | |
parent | 6df8fb83301d68ea0a0c0e1cbcc790fcc333ed12 (diff) | |
download | linux-700d4796ef59f5faf240d307839bd419e2b6bdff.tar.xz |
bpf: Optimize program stats
Move bpf_prog_stats from prog->aux into prog to avoid one extra load
in critical path of program execution.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210210033634.62081-2-alexei.starovoitov@gmail.com
Diffstat (limited to 'kernel/bpf/trampoline.c')
-rw-r--r-- | kernel/bpf/trampoline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c index 35c5887d82ff..5be3beeedd74 100644 --- a/kernel/bpf/trampoline.c +++ b/kernel/bpf/trampoline.c @@ -412,7 +412,7 @@ void notrace __bpf_prog_exit(struct bpf_prog *prog, u64 start) * Hence check that 'start' is not zero. */ start) { - stats = this_cpu_ptr(prog->aux->stats); + stats = this_cpu_ptr(prog->stats); u64_stats_update_begin(&stats->syncp); stats->cnt++; stats->nsecs += sched_clock() - start; |