diff options
| author | David Miller <[email protected]> | 2020-02-24 14:01:43 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-02-25 00:20:09 +0000 |
| commit | 3d9f773cf2876c01a505b9fe27270901d464e90a (patch) | |
| tree | d5ed0350db81b38cf8c0234d7c066f65595addff /scripts/bpf_helpers_doc.py | |
| parent | bpf: Replace cant_sleep() with cant_migrate() (diff) | |
| download | kernel-3d9f773cf2876c01a505b9fe27270901d464e90a.tar.gz kernel-3d9f773cf2876c01a505b9fe27270901d464e90a.zip | |
bpf: Use bpf_prog_run_pin_on_cpu() at simple call sites.
All of these cases are strictly of the form:
preempt_disable();
BPF_PROG_RUN(...);
preempt_enable();
Replace this with bpf_prog_run_pin_on_cpu() which wraps BPF_PROG_RUN()
with:
migrate_disable();
BPF_PROG_RUN(...);
migrate_enable();
On non RT enabled kernels this maps to preempt_disable/enable() and on RT
enabled kernels this solely prevents migration, which is sufficient as
there is no requirement to prevent reentrancy to any BPF program from a
preempting task. The only requirement is that the program stays on the same
CPU.
Therefore, this is a trivially correct transformation.
The seccomp loop does not need protection over the loop. It only needs
protection per BPF filter program
[ tglx: Converted to bpf_prog_run_pin_on_cpu() ]
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'scripts/bpf_helpers_doc.py')
0 files changed, 0 insertions, 0 deletions
