Thread (24 messages) 24 messages, 2 authors, 2020-02-23

[patch V2 04/20] perf/bpf: Remove preempt disable around BPF invocation

flat view
STALE2443d SUPERSEDED

From: Thomas Gleixner <hidden>
Date: 2020-02-20 20:57:44
Also in: bpf, lkml
Subsystem: performance events subsystem, the rest · Maintainers: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, Linus Torvalds

Status: Superseded by v3 (posted 2020-02-24). [go to v3]

Revision v2 (3 revisions archived).

Revisions (3)
  1. rfc
  2. v2 current [diff against previous]
  3. v3 [diff against previous]
The BPF invocation from the perf event overflow handler does not require to
disable preemption because this is called from NMI or at least hard
interrupt context which is already non-preemptible.

Signed-off-by: Thomas Gleixner <redacted>
---
 kernel/events/core.c |    2 --
 1 file changed, 2 deletions(-)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -9206,7 +9206,6 @@ static void bpf_overflow_handler(struct
 	int ret = 0;
 
 	ctx.regs = perf_arch_bpf_user_pt_regs(regs);
-	preempt_disable();
 	if (unlikely(__this_cpu_inc_return(bpf_prog_active) != 1))
 		goto out;
 	rcu_read_lock();
@@ -9214,7 +9213,6 @@ static void bpf_overflow_handler(struct
 	rcu_read_unlock();
 out:
 	__this_cpu_dec(bpf_prog_active);
-	preempt_enable();
 	if (!ret)
 		return;
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help