diff options
author | Alexei Starovoitov <ast@kernel.org> | 2021-02-10 04:36:26 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2021-02-11 16:17:50 +0100 |
commit | 700d4796ef59f5faf240d307839bd419e2b6bdff (patch) | |
tree | dc3d98f6691576479f2b727ce0d9ce7726b33ad7 /kernel/bpf/syscall.c | |
parent | bpf_lru_list: Read double-checked variable once without lock (diff) | |
download | linux-700d4796ef59f5faf240d307839bd419e2b6bdff.tar.xz linux-700d4796ef59f5faf240d307839bd419e2b6bdff.zip |
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/syscall.c')
-rw-r--r-- | kernel/bpf/syscall.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index e5999d86c76e..f7df56a704de 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -1739,7 +1739,7 @@ static void bpf_prog_get_stats(const struct bpf_prog *prog, unsigned int start; u64 tnsecs, tcnt; - st = per_cpu_ptr(prog->aux->stats, cpu); + st = per_cpu_ptr(prog->stats, cpu); do { start = u64_stats_fetch_begin_irq(&st->syncp); tnsecs = st->nsecs; |