Thread (42 messages) 42 messages, 6 authors, 16d ago

Re: [PATCH RFC v3 06/13] bpf: Take a Tasks Trace reader in the trampoline glue

flat view

From: Alexei Starovoitov <hidden>
Date: 2026-09-17 02:24:26
Also in: bpf, linux-arm-kernel, lkml, rcu, xen-devel

On Thu Sep 17, 2026 at 1:16 AM UTC, Josef Bacik wrote:
On Wed, 16 Sep 2026 03:45:16 +0000, Alexei Starovoitov wrote:
quoted
On Tue Sep 15, 2026 at 1:17 PM UTC, Josef Bacik wrote:
quoted
 	__acquires(RCU)
 {
+	bpf_tramp_read_lock_trace();
 	rcu_read_lock_dont_migrate();
This is double increment. rcu_read_lock_dont_migrate() includes
rcu_read_lock_trace().
Unless I'm looking at the wrong tree it doesn't, on Linus' master and on
bpf-next it is

	static __always_inline void rcu_read_lock_dont_migrate(void)
	{
		if (IS_ENABLED(CONFIG_PREEMPT_RCU))
			migrate_disable();
		rcu_read_lock();
	}

so plain RCU plus migrate_disable(), no Tasks Trace reader. That is why
the non-sleepable glue needs one added here: on these architectures the
trampoline image the glue returns into is only kept alive by Tasks RCU
while the task is a rcu_read_lock_trace() reader, and rcu_read_lock()
does not give us that.
Right. I got confused. Since rcu_read_lock_trace() CS will cover
both sleepable and non-sleepable prog types let's do it once
per fentry+fmod_ret region and 2nd time for fexit region.

We probably don't want to hold it for the whole trampoline,
since orig_call will delay freeing of progs.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help