__bpf_trace_run() disables preemption around the BPF_PROG_RUN() invocation. This is redundant because __bpf_trace_run() is invoked from a trace point via __DO_TRACE() which already disables preemption _before_ invoking any of the functions which are attached to a trace point. Remove it and add a cant_sleep() check.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -1516,10 +1516,9 @@ void bpf_put_raw_tracepoint(struct bpf_raw_event_map *btp) · 1515 unmodified lines | |||
| 1516 | static __always_inline | 1516 | static __always_inline |
| 1517 | void __bpf_trace_run(struct bpf_prog *prog, u64 *args) | 1517 | void __bpf_trace_run(struct bpf_prog *prog, u64 *args) |
| 1518 | { | 1518 | { |
| 1519 | cant_sleep(); | ||
| 1519 | rcu_read_lock(); | 1520 | rcu_read_lock(); |
| 1520 | preempt_disable(); | ||
| 1521 | (void) BPF_PROG_RUN(prog, args); | 1521 | (void) BPF_PROG_RUN(prog, args); |
| 1522 | preempt_enable(); | ||
| 1523 | rcu_read_unlock(); | 1522 | rcu_read_unlock(); |
| 1524 | } | 1523 | } |
| 1525 | 1524 | ||