]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Pull out a macro for interpreting atomic ALU operations
authorBrendan Jackman <jackmanb@google.com>
Thu, 14 Jan 2021 18:17:48 +0000 (18:17 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 15 Jan 2021 02:34:29 +0000 (18:34 -0800)
commit427e3b89b2dd78443963b4bc6ea9311c64f01d39
tree6d97a7890d74d3be0dd65e0f1822c3e57e8f4a25
parent9926a86ca42facc45f4a2c2b118f890242ae3365
bpf: Pull out a macro for interpreting atomic ALU operations

Since the atomic operations that are added in subsequent commits are
all isomorphic with BPF_ADD, pull out a macro to avoid the
interpreter becoming dominated by lines of atomic-related code.

Note that this sacrificies interpreter performance (combining
STX_ATOMIC_W and STX_ATOMIC_DW into single switch case means that we
need an extra conditional branch to differentiate them) in favour of
compact and (relatively!) simple C code.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210114181751.768687-9-jackmanb@google.com
kernel/bpf/core.c