[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230121043845.GE2948950@paulmck-ThinkPad-P17-Gen-1>
Date: Fri, 20 Jan 2023 20:38:45 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Jonas Oberhauser <jonas.oberhauser@...weicloud.com>
Cc: Alan Stern <stern@...land.harvard.edu>,
Andrea Parri <parri.andrea@...il.com>,
Jonas Oberhauser <jonas.oberhauser@...wei.com>,
Peter Zijlstra <peterz@...radead.org>, will <will@...nel.org>,
"boqun.feng" <boqun.feng@...il.com>, npiggin <npiggin@...il.com>,
dhowells <dhowells@...hat.com>,
"j.alglave" <j.alglave@....ac.uk>,
"luc.maranget" <luc.maranget@...ia.fr>, akiyks <akiyks@...il.com>,
dlustig <dlustig@...dia.com>, joel <joel@...lfernandes.org>,
urezki <urezki@...il.com>,
quic_neeraju <quic_neeraju@...cinc.com>,
frederic <frederic@...nel.org>,
Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: Internal vs. external barriers (was: Re: Interesting LKMM litmus
test)
On Fri, Jan 20, 2023 at 10:41:14PM +0100, Jonas Oberhauser wrote:
>
>
> On 1/20/2023 5:18 PM, Alan Stern wrote:
> > On Fri, Jan 20, 2023 at 11:13:00AM +0100, Jonas Oberhauser wrote:
> > > Perhaps we could say that reading an index without using it later is
> > > forbidden?
> > >
> > > flag ~empty [Srcu-lock];data;rf;[~ domain(data;[Srcu-unlock])] as
> > > thrown-srcu-cookie-on-floor
> > We already flag locks that don't have a matching unlock.
>
> Of course, but as you know this is completely orthogonal.
>
> > I don't see any point in worrying about whatever else happens to the index.
>
> Can you briefly explain how the operational model you have in mind for
> srcu's up and down allows x==1 (and y==0 and idx1==idx2) in the example I
> sent before (copied with minor edit below for convenience)?
>
> P0{
> idx1 = srcu_down(&ss);
> store_rel(p1, true);
>
>
> shared cs
>
> R x == 1
>
> while (! load_acq(p2));
> R idx2 == idx1 // for some reason, we got lucky!
> srcu_up(&ss,idx1);
> }
>
> P1{
> idx2 = srcu_down(&ss);
> store_rel(p2, true);
>
> shared cs
>
> R y == 0
>
> while (! load_acq(p1));
> srcu_up(&ss,idx2);
> }
>
> P2 {
> W y = 1
> srcu_sync(&ss);
> W x = 1
> }
>
>
> I can imagine models that allow this but they aren't pretty. Maybe you have
> a better operational model?
>
> >
> > > So if there is an srcu_down() that produces a cookie that is read by some
> > > read R, and R doesn't then pass that value into an srcu_up(), the
> > > srcu-warranty is voided.
> > No, it isn't.
> I quote Paul:
> "If you do anything else at all with it, anything at all, you just voided
> your SRCU warranty. For that matter, if you just throw that value on the
> floor and don't pass it to an srcu_up_read() execution, you also just voided
> your SRCU warranty."
I suspect that you guys are talking past one another. My guess is that
one of you is saying "we could check" and the other "we are not required
to check", which are not necessarily in disagreement.
But that is just a guess. You guys tell me! ;-)
Thanx, Paul
Powered by blists - more mailing lists