[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260103002343.6599-12-joelagnelf@nvidia.com>
Date: Fri, 2 Jan 2026 19:23:40 -0500
From: Joel Fernandes <joelagnelf@...dia.com>
To: linux-kernel@...r.kernel.org
Cc: "Paul E . McKenney" <paulmck@...nel.org>,
Frederic Weisbecker <frederic@...nel.org>,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
Joel Fernandes <joelagnelf@...dia.com>,
Josh Triplett <josh@...htriplett.org>,
Boqun Feng <boqun.feng@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Zqiang <qiang.zhang@...ux.dev>,
Uladzislau Rezki <urezki@...il.com>,
joel@...lfernandes.org,
rcu@...r.kernel.org
Subject: [PATCH RFC 11/14] rcu: Add per-CPU blocked list check in exit_rcu()
With per-CPU blocked lists, a task can be on either the rcu_node's
blkd_tasks list or on the per-CPU blocked list.
Therefore, extend exit_rcu() to check both lists. This ensures that if
a task exits while on any blocked list, the cleanup path will properly
handle it.
Signed-off-by: Joel Fernandes <joelagnelf@...dia.com>
---
kernel/rcu/tree_plugin.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 6ed3815bb912..8622e79660ed 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -978,8 +978,15 @@ static void rcu_flavor_sched_clock_irq(int user)
void exit_rcu(void)
{
struct task_struct *t = current;
+ bool on_list;
- if (unlikely(!list_empty(¤t->rcu_node_entry))) {
+ /* Check if task is on any blocked list (rnp or per-CPU). */
+ on_list = !list_empty(¤t->rcu_node_entry);
+#ifdef CONFIG_RCU_PER_CPU_BLOCKED_LISTS
+ on_list = on_list || !list_empty(¤t->rcu_rdp_entry);
+#endif
+
+ if (unlikely(on_list)) {
rcu_preempt_depth_set(1);
barrier();
WARN_ON_ONCE(!t->rcu_read_unlock_special.b.blocked);
--
2.34.1
Powered by blists - more mailing lists