lkml.org 
[lkml]   [2023]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2023-03-27 00:01    [W:0.086 / U:1.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site