The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	rostedt@goodmis.org, "Paul E. McKenney" <paulmck@kernel.org>,
	Puranjay Mohan <puranjay@kernel.org>,
	Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>
Subject: [PATCH v2 3/6] checkpatch: Undeprecate rcu_read_lock_trace() and rcu_read_unlock_trace()
Date: Fri,  8 May 2026 10:43:50 -0700	[thread overview]
Message-ID: <20260508174353.905746-3-paulmck@kernel.org> (raw)
In-Reply-To: <40ed4910-e20b-40a6-9598-7aa6abf006c5@paulmck-laptop>

It turns out that there are BPF use cases that rely on nesting RCU
Tasks Trace readers.  These use cases are well-served by the old
rcu_read_lock_trace() and rcu_read_unlock_trace() functions that maintain
a nesting counter in the task_struct structure.  But these use cases incur
a performance penalty when using the shiny new rcu_read_lock_tasks_trace()
and rcu_read_unlock_tasks_trace() functions, which nest in the same way
that SRCU does.

This means that rcu_read_lock_trace() and rcu_read_unlock_trace()
will be with us for some time.  Therefore, remove the checkpatch.pl
deprecation.

Also, the rcu_read_lock_tasks_trace() and rcu_read_unlock_tasks_trace()
functions are intended for use only by BPF.  Therefore, add them to
the list of functions that checkpatch complains about outside of BPF
(and of course, RCU).

Reported-by: Puranjay Mohan <puranjay@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
 scripts/checkpatch.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0492d6afc9a1fc..cc5bbd70cb843e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -865,8 +865,6 @@ our %deprecated_apis = (
 	"DEFINE_IDR"				=> "DEFINE_XARRAY",
 	"idr_init"				=> "xa_init",
 	"idr_init_base"				=> "xa_init_flags",
-	"rcu_read_lock_trace"			=> "rcu_read_lock_tasks_trace",
-	"rcu_read_unlock_trace"			=> "rcu_read_unlock_tasks_trace",
 );
 
 #Create a search pattern for all these strings to speed up a loop below
@@ -7596,12 +7594,15 @@ sub process {
 
 # Complain about RCU Tasks Trace used outside of BPF (and of course, RCU).
 		our $rcu_trace_funcs = qr{(?x:
+			rcu_read_lock_tasks_trace |
 			rcu_read_lock_trace |
 			rcu_read_lock_trace_held |
 			rcu_read_unlock_trace |
+			rcu_read_unlock_tasks_trace |
 			call_rcu_tasks_trace |
 			synchronize_rcu_tasks_trace |
 			rcu_barrier_tasks_trace |
+			rcu_tasks_trace_expedite_current |
 			rcu_request_urgent_qs_task
 		)};
 		our $rcu_trace_paths = qr{(?x:
-- 
2.40.1


  parent reply	other threads:[~2026-05-08 17:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 17:09 [PATCH 0/7] Miscellaneous RCU changes for v7.2 Paul E. McKenney
2026-05-07 17:09 ` [PATCH 1/7] srcu: Don't queue workqueue handlers to never-online CPUs Paul E. McKenney
2026-05-07 17:09 ` [PATCH 2/7] srcu: Fix kerneldoc header comment typo in srcu_down_read_fast() Paul E. McKenney
2026-05-07 17:09 ` [PATCH 3/7] checkpatch: Undeprecate rcu_read_lock_trace() and rcu_read_unlock_trace() Paul E. McKenney
2026-05-07 17:44   ` Joe Perches
2026-05-07 17:53     ` Paul E. McKenney
2026-05-07 17:09 ` [PATCH 4/7] checkpatch: Mark rcu_read_lock_tasks_trace() and friend BPF-only Paul E. McKenney
2026-05-07 17:09 ` [PATCH 5/7] rcu: Simplify rcu_do_batch() by applying clamp() Paul E. McKenney
2026-05-07 17:09 ` [PATCH 6/7] rcu: Simplify param_set_next_fqs_jiffies() by applying clamp_val() Paul E. McKenney
2026-05-07 17:09 ` [PATCH 7/7] rcu: Document rcu_access_pointer() feeding into cmpxchg() Paul E. McKenney
2026-05-08 17:06 ` [PATCH 0/7] Miscellaneous RCU changes for v7.2 Uladzislau Rezki
2026-05-08 17:27   ` Paul E. McKenney
2026-05-08 17:43 ` [PATCH v2 0/6] " Paul E. McKenney
2026-05-08 17:43   ` [PATCH v2 1/6] srcu: Don't queue workqueue handlers to never-online CPUs Paul E. McKenney
2026-05-08 17:43   ` [PATCH v2 2/6] srcu: Fix kerneldoc header comment typo in srcu_down_read_fast() Paul E. McKenney
2026-05-08 17:43   ` Paul E. McKenney [this message]
2026-05-08 17:43   ` [PATCH v2 4/6] rcu: Simplify rcu_do_batch() by applying clamp() Paul E. McKenney
2026-05-08 17:43   ` [PATCH v2 5/6] rcu: Simplify param_set_next_fqs_jiffies() by applying clamp_val() Paul E. McKenney
2026-05-08 17:43   ` [PATCH v2 6/6] rcu: Document rcu_access_pointer() feeding into cmpxchg() Paul E. McKenney
2026-05-11  9:19   ` [PATCH v2 0/6] Miscellaneous RCU changes for v7.2 Uladzislau Rezki

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=20260508174353.905746-3-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=puranjay@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