lkml.org 
[lkml]   [2021]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] locking: rwbase: Take care of ordering guarantee for fastpath reader
On Sat, Sep 04, 2021 at 12:14:29PM +0200, Peter Zijlstra wrote:
> On Fri, Sep 03, 2021 at 10:50:58PM +0800, Boqun Feng wrote:
> > > * ordering, either is strong enough to provide ACQUIRE order
> > > * for the above load of @readers.
> > > */
> > > rwbase_set_and_save_current_state(state);
> > > raw_spin_lock_irqsave(&rtm->wait_lock, flags);
> > >
> > > while (readers) {
> > > ...
> > > readers = atomic_read(&rwb->readers);
> >
> > The above should be _acquire(), right? Pairs with the last reader
> > exiting the critical section and dec ->readers to 0. If so, it
> > undermines the necessity of the restructure?
>
> This is the one that's followed by set_current_state(), no?

You're right. I was missing that ;-/

Regards,
Boqun

>

\
 
 \ /
  Last update: 2021-09-04 12:21    [W:0.079 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site