[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220324111515.1810160-1-qiang1.zhang@intel.com>
Date: Thu, 24 Mar 2022 19:15:15 +0800
From: Zqiang <qiang1.zhang@...el.com>
To: paulmck@...nel.org, frederic@...nel.org, quic_neeraju@...cinc.com
Cc: rcu@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] rcu: Check the validity of the boost_kthread_task pointer
The boost kthreads may spawn failed, although the probability of
creation failure is very low, in consideration of the robustness
of the code, add boost_kthread_task pointer detection.
Signed-off-by: Zqiang <qiang1.zhang@...el.com>
---
kernel/rcu/tree_plugin.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 6b9bcd45c7b2..fd642f14f31f 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1125,7 +1125,8 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags)
__releases(rnp->lock)
{
raw_lockdep_assert_held_rcu_node(rnp);
- if (!rcu_preempt_blocked_readers_cgp(rnp) && rnp->exp_tasks == NULL) {
+ if (!rnp->boost_kthread_task ||
+ (!rcu_preempt_blocked_readers_cgp(rnp) && rnp->exp_tasks == NULL)) {
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
return;
}
--
2.25.1
Powered by blists - more mailing lists