diff options
author | Song Liu <songliubraving@fb.com> | 2021-02-25 15:43:19 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-02-26 11:51:48 -0800 |
commit | ced47e30ab8b3ed986e28411f63e041b51c1fdf8 (patch) | |
tree | f432e5e8e45d7f1b11feca958eec1ef084c9497c /arch/nios2 | |
parent | 4b0d2d4156cfb9f27d8e52a33d3522a78002fca1 (diff) | |
download | linux-ced47e30ab8b3ed986e28411f63e041b51c1fdf8.tar.bz2 |
bpf: runqslower: Use task local storage
Replace hashtab with task local storage in runqslower. This improves the
performance of these BPF programs. The following table summarizes average
runtime of these programs, in nanoseconds:
task-local hash-prealloc hash-no-prealloc
handle__sched_wakeup 125 340 3124
handle__sched_wakeup_new 2812 1510 2998
handle__sched_switch 151 208 991
Note that, task local storage gives better performance than hashtab for
handle__sched_wakeup and handle__sched_switch. On the other hand, for
handle__sched_wakeup_new, task local storage is slower than hashtab with
prealloc. This is because handle__sched_wakeup_new accesses the data for
the first time, so it has to allocate the data for task local storage.
Once the initial allocation is done, subsequent accesses, as those in
handle__sched_wakeup, are much faster with task local storage. If we
disable hashtab prealloc, task local storage is much faster for all 3
functions.
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210225234319.336131-7-songliubraving@fb.com
Diffstat (limited to 'arch/nios2')
0 files changed, 0 insertions, 0 deletions