[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250911051009.682429-1-kaushlendra.kumar@intel.com>
Date: Thu, 11 Sep 2025 10:40:09 +0530
From: Kaushlendra Kumar <kaushlendra.kumar@...el.com>
To: dave@...olabs.net,
paulmck@...nel.org,
josh@...htriplett.org,
frederic@...nel.org,
neeraj.upadhyay@...nel.org,
rostedt@...dmis.org
Cc: linux-kernel@...r.kernel.org,
rcu@...r.kernel.org,
Kaushlendra Kumar <kaushlendra.kumar@...el.com>
Subject: [PATCH] rcu/segcblist: Use WRITE_ONCE() for rclp->len decrement
The rclp->len field is accessed concurrently by multiple contexts
in RCU operations. Using WRITE_ONCE() provides the necessary memory
ordering guarantees.
This change ensures that the callback list length is updated atomically
and provides consistent visibility across different CPU contexts,
maintaining the integrity of RCU callback list management.
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@...el.com>
---
kernel/rcu/rcu_segcblist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c
index 1693ea22ef1b..e10b36e9de54 100644
--- a/kernel/rcu/rcu_segcblist.c
+++ b/kernel/rcu/rcu_segcblist.c
@@ -71,7 +71,7 @@ struct rcu_head *rcu_cblist_dequeue(struct rcu_cblist *rclp)
rhp = rclp->head;
if (!rhp)
return NULL;
- rclp->len--;
+ WRITE_ONCE(rclp->len, rclp->len - 1);
rclp->head = rhp->next;
if (!rclp->head)
rclp->tail = &rclp->head;
--
2.34.1
Powered by blists - more mailing lists