From: Zqiang <qiang1.zhang@intel.com>
To: paulmck@kernel.org, frederic@kernel.org,
quic_neeraju@quicinc.com, joel@joelfernandes.org
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE()
Date: Tue, 12 Jul 2022 16:26:05 +0800 [thread overview]
Message-ID: <20220712082606.3662616-2-qiang1.zhang@intel.com> (raw)
In-Reply-To: <20220712082606.3662616-1-qiang1.zhang@intel.com>
For kernel build with CONFIG_PROVE_RCU=y and CONFIG_DEBUG_LOCK_ALLOC=y,
when the synchronize_rcu_tasks_generic() called occurs during the
rcu_scheduler_active variable is RCU_SCHEDULER_INACTIVE, the warnings
will be trigger, however the warnings is not actually triggered because
the debug_lockdep_rcu_enabled() return false(the rcu_scheduler_active !=
RCU_SCHEDULER_INACTIVE condition is false).
This commit replace RCU_LOCKDEP_WARN() with WARN_ONCE() to trigger
warnings.
Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
kernel/rcu/tasks.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index 83c7e6620d40..469bf2a3b505 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -560,7 +560,7 @@ static int __noreturn rcu_tasks_kthread(void *arg)
static void synchronize_rcu_tasks_generic(struct rcu_tasks *rtp)
{
/* Complain if the scheduler has not started. */
- RCU_LOCKDEP_WARN(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE,
+ WARN_ONCE(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE,
"synchronize_rcu_tasks called too soon");
// If the grace-period kthread is running, use it.
--
2.25.1
next prev parent reply other threads:[~2022-07-12 8:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 8:26 [PATCH 0/2] Optimize synchronize_rcu_tasks_generic() on early booting Zqiang
2022-07-12 8:26 ` Zqiang [this message]
2022-07-12 17:28 ` [PATCH 1/2] rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE() Paul E. McKenney
2022-07-12 8:26 ` [PATCH 2/2] rcu-tasks: Make synchronize_rcu_tasks_generic() no-ops on early booting Zqiang
2022-07-12 17:37 ` Paul E. McKenney
2022-07-14 1:53 ` Zhang, Qiang1
2022-07-14 3:37 ` 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=20220712082606.3662616-2-qiang1.zhang@intel.com \
--to=qiang1.zhang@intel.com \
--cc=frederic@kernel.org \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=quic_neeraju@quicinc.com \
--cc=rcu@vger.kernel.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
all inboxes | Powered by JetHome®