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
15161516 static __always_inline
15171517 void __bpf_trace_run(struct bpf_prog *prog, u64 *args)
15181518 {
1519+ cant_sleep();
15191520 rcu_read_lock();
1520− preempt_disable();
15211521 (void) BPF_PROG_RUN(prog, args);
1522− preempt_enable();
15231522 rcu_read_unlock();
15241523 }
15251524

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