From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: paulmck@kernel.org
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
Joel Fernandes <joelagnelf@nvidia.com>,
Josh Triplett <josh@joshtriplett.org>,
Boqun Feng <boqun@kernel.org>,
Uladzislau Rezki <urezki@gmail.com>, Thomas Graf <tgraf@suug.ch>,
Herbert Xu <herbert@gondor.apana.org.au>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Andrew Morton <akpm@linux-foundation.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Zqiang <qiang.zhang@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jiri Olsa <jolsa@kernel.org>,
Emil Tsalapatis <emil@etsalapatis.com>,
Ihor Solodrai <ihor.solodrai@linux.dev>,
rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-crypto@vger.kernel.org, bpf@vger.kernel.org,
linux-trace-kernel@vger.kernel.org,
Roman Gushchin <roman.gushchin@linux.dev>,
Chris Mason <clm@meta.com>
Subject: Re: [RFC PATCH 0/3] fprobe, rcu/tasks, rhashtable: Switch fprobe and BPF kprobe-multi to Tasks-Rude RCU
Date: Wed, 30 Sep 2026 09:35:26 +0900 [thread overview]
Message-ID: <20260930093526.53be607c55184faf05e8d1f8@kernel.org> (raw)
In-Reply-To: <41b37fed-af5c-4559-9e4e-696ef8ccfdd0@paulmck-laptop>
On Mon, 28 Sep 2026 17:41:57 -0700
"Paul E. McKenney" <paulmck@kernel.org> wrote:
> > > > Thanks for the clarification!
> > > > So I think we can replace rcu_read_lock() with rcu_read_lock_sched_notrace()?
> > > > (also, maybe we need to add rcu_is_watching() check)
> > >
> > > That would work, and yes, you are quite right that if !rcu_is_watching(),
> > > RCU is studiously ignoring you completely, no matter what your preemption
> > > state is.
> > >
> > > > Current code may involves lockdep in fprobe, that is not good.
> > >
> > > Agreed, that could be problematic in any number of contexts. ;-)
> > >
> > > > BTW, if we want to trace some code in extended quiescent state, do we
> > > > still need this Tasks-Rude RCU?
> > >
> > > Well, you need something other than vanilla RCU, anyway. And Tasks Rude
> > > RCU is one candidate, though it is also a candidate that might annoy
> > > people wishing to minimize IPIs.
> >
> > Would RCU Tasks Trace be a better candidate given uprobes and
> > sleepable BPF depends on it? Would it work here?
Hmm, those can be sleepable, but this is not. fprobe is based on ftrace
so the callbacks are non preemptive.
>
> Quite possibly! Of course, there might be corner-case ftrace/BPF issues
> that you and Masami would know better than would I.
>
> David Woodhouse suggests the new Atomic SRCU for a vaguely similar
> purpose:
>
> https://lore.kernel.org/all/20260920211920.928306-1-dwmw2@infradead.org/
>
> Now that Tasks Trace RCU is implemented in terms of SRCU-fast, there
> might not be all that much air between David's suggestion and yours.
OK, let me check it. But at a glance, this atomic SRCU is still a bit
heavier than rcu_sched_notrace, for fprobe. It involves smp_mb and lockdep.
So if all of these rcu_read_lock() in fprobe are replaced with
rcu_read_lock_sched_notrace(), isn't it enough to switch the
synchronize_rcu() to synchronize_rcu_tasks_rude() for avoiding
`if (!rcu_is_watching()) return;` ?
(Note, most of replacement will be done by [1])
[1] https://lore.kernel.org/all/179064115227.394389.16910234241400391996.stgit@devnote2/
Thank you,
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2026-09-30 0:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 14:29 Masami Hiramatsu (Google)
2026-09-28 14:29 ` [RFC PATCH 1/3] rcu/tasks: Export call_rcu_tasks_rude() Masami Hiramatsu (Google)
2026-09-28 15:17 ` bot+bpf-ci
2026-09-28 14:29 ` [RFC PATCH 2/3] rhashtable: Add use_tasks_rude parameter to defer bucket table free Masami Hiramatsu (Google)
2026-09-28 14:29 ` [RFC PATCH 3/3] fprobe: Switch fprobe and BPF kprobe-multi to Tasks-Rude RCU Masami Hiramatsu (Google)
2026-09-28 16:25 ` [RFC PATCH 0/3] fprobe, rcu/tasks, rhashtable: " Paul E. McKenney
2026-09-28 23:28 ` Masami Hiramatsu
2026-09-29 0:04 ` Paul E. McKenney
2026-09-29 0:33 ` Andrii Nakryiko
2026-09-29 0:41 ` Paul E. McKenney
2026-09-30 0:35 ` Masami Hiramatsu [this message]
2026-09-30 0:47 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260930093526.53be607c55184faf05e8d1f8@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=boqun@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=frederic@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=ihor.solodrai@linux.dev \
--cc=jiangshanlai@gmail.com \
--cc=joelagnelf@nvidia.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=josh@joshtriplett.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mathieu.desnoyers@efficios.com \
--cc=memxor@gmail.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=qiang.zhang@linux.dev \
--cc=rcu@vger.kernel.org \
--cc=roman.gushchin@linux.dev \
--cc=rostedt@goodmis.org \
--cc=song@kernel.org \
--cc=tgraf@suug.ch \
--cc=urezki@gmail.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®