lkml.org 
[lkml]   [2022]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/4] rcu/kvfree: Move need_offload_krc() out of krcp->lock
On Wed, Nov 30, 2022 at 01:56:17PM +0100, Uladzislau Rezki wrote:
> On Tue, Nov 29, 2022 at 03:38:33PM -0800, Paul E. McKenney wrote:
> > On Tue, Nov 29, 2022 at 04:58:21PM +0100, Uladzislau Rezki (Sony) wrote:
> > > Currently a need_offload_krc() function requires the krcp->lock
> > > to be held because krcp->head can not be checked concurrently.
> > >
> > > Fix it by updating the krcp->head using WRITE_ONCE() macro so
> > > it becomes lock-free and safe for readers to see a valid data
> > > without any locking.
> >
> > Don't we also need to use READ_ONCE() for the code loading this krcp->head
> > pointer? Or do the remaining plain C-language accesses somehow avoid
> > running concurrently with those new WRITE_ONCE() invocations?
> >
> It can be concurrent. I was thinking about it. For some reason i decided
> to keep readers as a "regular" ones for loading the krcp->head.
>
> In this case it might take time for readers to see an updated value
> as a worst case scenario.
>
> So i need to update it or upload one more patch on top of v2. Should
> i upload a new patch?

Sending an additional patch should be fine. Unless you would rather it
be folded into one of the existing patches, in which case please start
with the set that I have queued.

Thanx, Paul

\
 
 \ /
  Last update: 2022-11-30 19:47    [W:0.478 / U:1.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site