[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC v2 08/15] bpf, x86: Maintain Tasks RCU trampoline nesting in the BPF trampoline
- To: <paulmck@xxxxxxxxxx>
- From: "Alexei Starovoitov" <alexei.starovoitov@xxxxxxxxx>
- Date: Sat, 12 Sep 2026 12:40:55 -0700
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="In-Reply-To:References:To:From:Subject:Cc:Message-Id:Date:Content-Type:Content-Transfer-Encoding:Mime-Version"
- Cc: "Josef Bacik" <josef@xxxxxxxxxxxxxx>, "Frederic Weisbecker" <frederic@xxxxxxxxxx>, "Neeraj Upadhyay" <neeraj.upadhyay@xxxxxxxxxx>, "Joel Fernandes" <joelagnelf@xxxxxxxxxx>, "Boqun Feng" <boqun@xxxxxxxxxx>, "Thomas Gleixner" <tglx@xxxxxxxxxx>, "Peter Zijlstra" <peterz@xxxxxxxxxxxxx>, "Steven Rostedt" <rostedt@xxxxxxxxxxx>, "Masami Hiramatsu" <mhiramat@xxxxxxxxxx>, "Mark Rutland" <mark.rutland@xxxxxxx>, "Jiri Olsa" <jolsa@xxxxxxxxxx>, "Alexei Starovoitov" <ast@xxxxxxxxxx>, "Daniel Borkmann" <daniel@xxxxxxxxxxxxx>, "Andrii Nakryiko" <andrii@xxxxxxxxxx>, <x86@xxxxxxxxxx>, "Catalin Marinas" <catalin.marinas@xxxxxxx>, "Will Deacon" <will@xxxxxxxxxx>, "Puranjay Mohan" <puranjay@xxxxxxxxxx>, "Xu Kuohai" <xukuohai@xxxxxxxxxxxxxxx>, "Andy Lutomirski" <luto@xxxxxxxxxx>, "Josh Triplett" <josh@xxxxxxxxxxxxxxxx>, "Uladzislau Rezki" <urezki@xxxxxxxxx>, "Mathieu Desnoyers" <mathieu.desnoyers@xxxxxxxxxxxx>, "Lai Jiangshan" <jiangshanlai@xxxxxxxxx>, "Zqiang" <qiang.zhang@xxxxxxxxx>, "Juergen Gross" <jgross@xxxxxxxx>, "Luis Chamberlain" <mcgrof@xxxxxxxxxx>, "Ihor Solodrai" <ihor.solodrai@xxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <rcu@xxxxxxxxxxxxxxx>, <linux-trace-kernel@xxxxxxxxxxxxxxx>, <bpf@xxxxxxxxxxxxxxx>, <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Sat, 12 Sep 2026 19:41:15 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Sat Sep 12, 2026 at 11:03 AM PDT, Paul E. McKenney wrote:
>
> In the old kernels, yes, we have current->trc_reader_nesting++.
> In the newer kernels, Tasks Trace RCU is instead implemented in terms
> of SRCU-fast, which instead increments per-CPU counters. Which among
> other thins is a bit faster and does not need to hook into the scheduler.
old kernels? I'm confused.
rcu_read_lock_trace() in bpf-next is doing t->trc_reader_nesting++
and then calls __srcu_read_lock_fast().
Are you talking about some RCU branch that you target for next merge window?
>
> So we have several ways forward:
>
> 1. Revert the implementation of RCU Tasks Trace in terms of
> SRCU-fast, and use the existing current->trc_reader_nesting++,
> as you suggest.
>
> 2. Deprecate RCU Tasks Trace entirely in favor of RCU Tasks
> augmented by rcu_tasks_trampoline_enter() and friends, as
> I was suggesting.
>
> 3. Implement rcu_tasks_trampoline_enter() in terms of SRCU-fast,
> keeping the speedup, and put a synchronize_srcu() in the
> RCU Tasks grace-period mechanism. This again deprecates
> RCU Tasks Trace entirely in favor of the augmented RCU Tasks.
>
> 4. It is always good to explicitly state the apparent status quo,
> which involves redundant trampoline entry/exit overhead.
>
> 5. As always, your additional ideas here!
>
> Thanx, Paul
|