History

bpf/tracing: Remove redundant preempt_disable() in __bpf_trace_run()

__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.

Thomas Gleixner committed 6 years ago

Commit f03efe41 parent dbca1511 file · +1 −2Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/trace/bpf_trace.c+1−2
@@ -1516,10 +1516,9 @@ void bpf_put_raw_tracepoint(struct bpf_raw_event_map *btp) · 1515 unmodified lines
1516static __always_inline1516static __always_inline
1517void __bpf_trace_run(struct bpf_prog *prog, u64 *args)1517void __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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t