[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y9co8OxyRehs8mob@rowland.harvard.edu>
Date: Sun, 29 Jan 2023 21:18:24 -0500
From: Alan Stern <stern@...land.harvard.edu>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: Boqun Feng <boqun.feng@...il.com>,
Andrea Parri <parri.andrea@...il.com>,
Jonas Oberhauser <jonas.oberhauser@...weicloud.com>,
will@...nel.org, peterz@...radead.org, npiggin@...il.com,
dhowells@...hat.com, j.alglave@....ac.uk, luc.maranget@...ia.fr,
akiyks@...il.com, dlustig@...dia.com, joel@...lfernandes.org,
urezki@...il.com, quic_neeraju@...cinc.com, frederic@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] tools/memory-model: Make ppo a subrelation of po
On Sun, Jan 29, 2023 at 03:09:00PM -0800, Paul E. McKenney wrote:
> On Sun, Jan 29, 2023 at 01:43:53PM -0800, Boqun Feng wrote:
> > in lock.cat:
> >
> > (* Allow up to one unmatched LKW per location; more must deadlock *)
> > let UNMATCHED-LKW = LKW \ domain(critical)
> > empty ([UNMATCHED-LKW] ; loc ; [UNMATCHED-LKW]) \ id as unmatched-locks
> >
> > we rule out deadlocks from the execution candidates we care about.
>
> Thank you, Boqun!
Actually that's only part of it. The other part is rather obscure:
(* Generate all co relations, including LKW events but not UL *)
let co0 = co0 | ([IW] ; loc ; [LKW]) |
(([LKW] ; loc ; [UNMATCHED-LKW]) \ [UNMATCHED-LKW])
Implicitly this says that any lock with no corresponding unlock must
come last in the coherence order, which implies the unmatched-locks rule
(since only one lock event can be last). By itself, the unmatched-locks
rule would not prevent P3 from executing before P1, provided P1 executes
both its lock and unlock.
Alan
Powered by blists - more mailing lists