Skip to contentSkip to conversation

linux-next: manual merge of the ftrace tree with the bpf-next tree

PATCH Mark Brown 3 participants 4 messages Feb 2

Subsystems (5)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

Today's linux-next merge of the ftrace tree got a conflict in:

kernel/trace/bpf_trace.c

between commit:

93f0d09697613 ("bpf: move recursion detection logic to helpers")

from the bpf-next tree and commit:

f7d327654b886 ("bpf: Have __bpf_trace_run() use rcu_read_lock_dont_migrate()")

from the ftrace tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

kernel/trace/bpf_trace.c +0 -0
diff --cc kernel/trace/bpf_trace.c
index f7baeb8278cac,abbf0177ad20b..0000000000000
@@@ -2076,8 -2062,8 +2076,8 @@@ void __bpf_trace_run(struct bpf_raw_tp_
  	struct bpf_run_ctx *old_run_ctx;
  	struct bpf_trace_run_ctx run_ctx;
  
- 	cant_sleep();
+ 	rcu_read_lock_dont_migrate();
 -	if (unlikely(this_cpu_inc_return(*(prog->active)) != 1)) {
 +	if (unlikely(!bpf_prog_get_recursion_context(prog))) {
  		bpf_prog_inc_misses_counter(prog);
  		goto out;
  	}
@@@ -2090,8 -2075,8 +2089,8 @@@
  
  	bpf_reset_run_ctx(old_run_ctx);
  out:
 -	this_cpu_dec(*(prog->active));
 +	bpf_prog_put_recursion_context(prog);
+ 	rcu_read_unlock_migrate();
  }
  
  #define UNPACK(...)			__VA_ARGS__
maintainer
#1 lore raw
Quoted 6 lines · On Mon, 2 Feb 2026 14:30:14 +0000 Mark Brown <[email protected]> wrote:

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Thanks Mark, the fix looks good to me. The conflict was caused by ftrace doing a small change that was recommended by Alexei so I hope this isn't a complex conflict ;-)

-- Steve

#2 lore raw
Quoted 11 lines · Steven Rostedt
Quoted 6 lines · On Mon, 2 Feb 2026 14:30:14 +0000 Mark Brown <[email protected]> wrote:

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Quoted 3 lines

Thanks Mark, the fix looks good to me. The conflict was caused by ftrace doing a small change that was recommended by Alexei so I hope this isn't a complex conflict ;-)

yep.
Conflict resolution is correct.

I wonder whether we should take the whole srcu_fast in tracepoints patch set into bpf-next to avoid this conflict ? Probably not worth it in the last week before the merge window. Just a thought.

maintainer
#3 lore raw
Quoted 4 lines · On Mon, 2 Feb 2026 08:42:55 -0800 Alexei Starovoitov…

I wonder whether we should take the whole srcu_fast in tracepoints patch set into bpf-next to avoid this conflict ? Probably not worth it in the last week before the merge window. Just a thought.

It's already in next where it would require a revert to get rid of.

There's just one patch that touches the bpf code, so it still makes more sense to keep it in the tracing tree.

-- Steve