Skip to content

Commit 3ed04e3

Browse files
paulmckrcuFrederic Weisbecker
authored andcommitted
rcu: Mark diagnostic functions as notrace
The rcu_lockdep_current_cpu_online(), rcu_read_lock_sched_held(), rcu_read_lock_held(), rcu_read_lock_bh_held(), rcu_read_lock_any_held() are used by tracing-related code paths, so putting traces on them is unlikely to make anyone happy. This commit therefore marks them all "notrace". Reported-by: Leon Hwang <leon.hwang@linux.dev> Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
1 parent 8c8250e commit 3ed04e3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

kernel/rcu/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4021,7 +4021,7 @@ bool rcu_cpu_online(int cpu)
40214021
* RCU on an offline processor during initial boot, hence the check for
40224022
* rcu_scheduler_fully_active.
40234023
*/
4024-
bool rcu_lockdep_current_cpu_online(void)
4024+
bool notrace rcu_lockdep_current_cpu_online(void)
40254025
{
40264026
struct rcu_data *rdp;
40274027
bool ret = false;

kernel/rcu/update.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static bool rcu_read_lock_held_common(bool *ret)
117117
return false;
118118
}
119119

120-
int rcu_read_lock_sched_held(void)
120+
int notrace rcu_read_lock_sched_held(void)
121121
{
122122
bool ret;
123123

@@ -342,7 +342,7 @@ EXPORT_SYMBOL_GPL(debug_lockdep_rcu_enabled);
342342
* Note that rcu_read_lock() is disallowed if the CPU is either idle or
343343
* offline from an RCU perspective, so check for those as well.
344344
*/
345-
int rcu_read_lock_held(void)
345+
int notrace rcu_read_lock_held(void)
346346
{
347347
bool ret;
348348

@@ -367,7 +367,7 @@ EXPORT_SYMBOL_GPL(rcu_read_lock_held);
367367
* Note that rcu_read_lock_bh() is disallowed if the CPU is either idle or
368368
* offline from an RCU perspective, so check for those as well.
369369
*/
370-
int rcu_read_lock_bh_held(void)
370+
int notrace rcu_read_lock_bh_held(void)
371371
{
372372
bool ret;
373373

@@ -377,7 +377,7 @@ int rcu_read_lock_bh_held(void)
377377
}
378378
EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held);
379379

380-
int rcu_read_lock_any_held(void)
380+
int notrace rcu_read_lock_any_held(void)
381381
{
382382
bool ret;
383383

0 commit comments

Comments
 (0)