[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f5d5811c-4908-45e8-9db7-c7cc00b45649@paulmck-laptop>
Date: Thu, 11 Sep 2025 12:37:33 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: "Kumar, Kaushlendra" <kaushlendra.kumar@...el.com>
Cc: "dave@...olabs.net" <dave@...olabs.net>,
"josh@...htriplett.org" <josh@...htriplett.org>,
"frederic@...nel.org" <frederic@...nel.org>,
"neeraj.upadhyay@...nel.org" <neeraj.upadhyay@...nel.org>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rcu@...r.kernel.org" <rcu@...r.kernel.org>
Subject: Re: [PATCH] rcu/segcblist: Use WRITE_ONCE() for rclp->len decrement
On Thu, Sep 11, 2025 at 03:46:08PM +0000, Kumar, Kaushlendra wrote:
> On Thu, Sep 11, 2025 at 10:40:09AM +0530, Paul E. McKenney wrote:
> > On Thu, Sep 11, 2025 at 10:40:09AM +0530, Kaushlendra Kumar wrote:
> > > The rclp->len field is accessed concurrently by multiple contexts in
> > > RCU operations. Using WRITE_ONCE() provides the necessary memory
> > > ordering guarantees.
> >
> > Could you please be specific here? What calls to rcu_cblist_dequeue() are such that hte ->qlen field can be concurrently accessed?
> >
> > (Full disclosure: I don't see any, and KCSAN hasn't found any. Of course, that does not necessarily mean that there is no concurrent access.
> > But we need such concurrent access called out explicitly here, because it might well be that the concurrent access is itself the bug.)
> >
> > Thanx, Paul
>
> Hi Paul,
>
> Thank you for the clarification. You are absolutely correct. After reviewing the
> code more carefully, I cannot identify specific concurrent access patterns for
> the rclp->len field during rcu_cblist_dequeue() operations.
>
> The primary motivation for this patch was to maintain consistency with
> rcu_cblist_enqueue(), which uses WRITE_ONCE() for the rclp->len increment.
>
> I will modify the message accordingly and send a patch.
Why exactly is a patch needed for this case?
Thanx, Paul
Powered by blists - more mailing lists