diff options
| author | Thomas Gleixner <[email protected]> | 2020-02-24 15:01:48 +0100 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-02-24 16:20:10 -0800 |
| commit | 085fee1a72a9fba101a4a68a2c02fa8bd2b6f913 (patch) | |
| tree | e215f625f6ca1185cd82d9fd65a2585c109f6b5d /tools/perf/scripts/python | |
| parent | c518cfa0c5ad75ddf3d743f1e35b9cf5fc2c346e (diff) | |
bpf: Use recursion prevention helpers in hashtab code
The required protection is that the caller cannot be migrated to a
different CPU as these places take either a hash bucket lock or might
trigger a kprobe inside the memory allocator. Both scenarios can lead to
deadlocks. The deadlock prevention is per CPU by incrementing a per CPU
variable which temporarily blocks the invocation of BPF programs from perf
and kprobes.
Replace the open coded preempt_disable/enable() and this_cpu_inc/dec()
pairs with the new recursion prevention helpers to prepare BPF to work on
PREEMPT_RT enabled kernels. On a non-RT kernel the migrate disable/enable
in the helpers map to preempt_disable/enable(), i.e. no functional change.
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 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions