summaryrefslogtreecommitdiffstats
path: root/kernel/bpf/hashtab.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-02-24 15:01:47 +0100
committerAlexei Starovoitov <ast@kernel.org>2020-02-24 16:20:09 -0800
commitc518cfa0c5ad75ddf3d743f1e35b9cf5fc2c346e (patch)
treedc1af99817725ada8e5cae4c91e49dd113d41d0b /kernel/bpf/hashtab.c
parent2a916f2f546ca1c1e3323e2a4269307f6d9890eb (diff)
bpf: Provide recursion prevention helpers
The places which need to prevent the execution of trace type BPF programs to prevent deadlocks on the hash bucket lock do this open coded. Provide two inline functions, bpf_disable/enable_instrumentation() to replace these open coded protection constructs. Use migrate_disable/enable() instead of preempt_disable/enable() right away so this works on RT enabled kernels. On a !RT kernel migrate_disable / enable() are mapped to preempt_disable/enable(). These helpers use this_cpu_inc/dec() instead of __this_cpu_inc/dec() on an RT enabled kernel because migrate disabled regions are preemptible and preemption might hit in the middle of a RMW operation which can lead to inconsistent state. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200224145644.103910133@linutronix.de
Diffstat (limited to 'kernel/bpf/hashtab.c')
0 files changed, 0 insertions, 0 deletions