From: Joe Perches <joe@perches.com>
To: paulmck@kernel.org
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, rostedt@goodmis.org,
Andy Whitcroft <apw@canonical.com>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
bpf@vger.kernel.org
Subject: Re: [PATCH rcu 5/5] checkpatch: Complain about unexpected uses of RCU Tasks Trace
Date: Thu, 20 Jul 2023 21:38:51 -0700 [thread overview]
Message-ID: <be08b429164e18b70f8341eab3deb075fc8b63b4.camel@perches.com> (raw)
In-Reply-To: <c0ca3071-231a-49b1-b153-38ff0328470d@paulmck-laptop>
On Thu, 2023-07-20 at 20:56 -0700, Paul E. McKenney wrote:
>
> > That works much better, thank you! I will update the patch on my
> > next rebase.
>
> As shown below. Is this what you had in mind?
[]
> commit 496aa3821b40459b107f4bbc14ca867daad21fb6
> Author: Paul E. McKenney <paulmck@kernel.org>
> Date: Thu Jul 6 11:48:07 2023 -0700
>
> checkpatch: Complain about unexpected uses of RCU Tasks Trace
>
> RCU Tasks Trace is quite specialized, having been created specifically
> for sleepable BPF programs. Because it allows general blocking within
> readers, any new use of RCU Tasks Trace must take current use cases into
> account. Therefore, update checkpatch.pl to complain about use of any of
> the RCU Tasks Trace API members outside of BPF and outside of RCU itself.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -7457,6 +7457,30 @@ sub process {
> }
> }
>
> +# Complain about RCU Tasks Trace used outside of BPF (and of course, RCU).
> + our $rcu_trace_funcs = qr{(?x:
> + rcu_read_lock_trace |
> + rcu_read_lock_trace_held |
> + rcu_read_unlock_trace |
> + call_rcu_tasks_trace |
> + synchronize_rcu_tasks_trace |
> + rcu_barrier_tasks_trace |
> + rcu_request_urgent_qs_task
> + )};
> + our $rcu_trace_paths = qr{(?x:
> + kernel/bpf/ |
> + include/linux/bpf |
> + net/bpf/ |
> + kernel/rcu/ |
> + include/linux/rcu
> + )};
> + if ($line =~ /\b$rcu_trace_funcs\s*\(/) {
> + if ($realfile !~ m@^$rcu_trace_paths@) {
> + WARN("RCU_TASKS_TRACE",
> + "use of RCU tasks trace is incorrect outside BPF or core RCU code\n" . $herecurr);
Exactly yes.
(though I still suggest a capture group to show the function like below)
if ($line =~ /\b($rcu_trace_funcs)\s*\(/ &&
$realfile !~ m{^$rcu_trace_paths}) {
WARN("RCU_TASKS_TRACE",
"use of RCU task trace '$1' is incorrect outside BPF or core RCU code\n" . $herecurr);
}
next prev parent reply other threads:[~2023-07-21 4:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <a6fff63c-5930-4918-82a3-a9301309d88d@paulmck-laptop>
2023-07-17 18:04 ` [PATCH rcu 5/5] checkpatch: Complain about unexpected uses of RCU Tasks Trace Paul E. McKenney
2023-07-17 22:34 ` Joe Perches
2023-07-17 23:34 ` Paul E. McKenney
2023-07-19 11:51 ` Joel Fernandes
2023-07-19 18:27 ` Paul E. McKenney
2023-07-19 18:44 ` Joe Perches
2023-07-19 19:02 ` Paul E. McKenney
2023-07-20 7:29 ` Joe Perches
2023-07-20 19:43 ` Paul E. McKenney
2023-07-21 3:56 ` Paul E. McKenney
2023-07-21 4:38 ` Joe Perches [this message]
2023-07-21 22:34 ` 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=be08b429164e18b70f8341eab3deb075fc8b63b4.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dwaipayanray1@gmail.com \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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