]> Git Repo - linux.git/commit
bpf: Avoid setting bpf insns pages read-only when prog is jited
authorDaniel Borkmann <[email protected]>
Fri, 29 Nov 2019 22:29:11 +0000 (23:29 +0100)
committerAlexei Starovoitov <[email protected]>
Sun, 1 Dec 2019 17:34:03 +0000 (09:34 -0800)
commite1608f3fa857b600045b6df7f7dadc70eeaa4496
tree5993631f992a9465dc0036dabe9c6890d948acf2
parentdf786c9b947639aedbc7bb44b5dae2a7824af360
bpf: Avoid setting bpf insns pages read-only when prog is jited

For the case where the interpreter is compiled out or when the prog is jited
it is completely unnecessary to set the BPF insn pages as read-only. In fact,
on frequent churn of BPF programs, it could lead to performance degradation of
the system over time since it would break the direct map down to 4k pages when
calling set_memory_ro() for the insn buffer on x86-64 / arm64 and there is no
reverse operation. Thus, avoid breaking up large pages for data maps, and only
limit this to the module range used by the JIT where it is necessary to set
the image read-only and executable.

Suggested-by: Peter Zijlstra <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
include/linux/filter.h
This page took 0.05561 seconds and 4 git commands to generate.