Re: [PATCH v3 1/3] lockdep: Make LOCKDEP_CROSSRELEASE configs all part of PROVE_LOCKING

From: Byungchul Park
Date: Thu Aug 24 2017 - 03:31:09 EST


On Thu, Aug 24, 2017 at 11:02:36AM +0900, Byungchul Park wrote:
> On Wed, Aug 23, 2017 at 12:20:48PM +0200, Peter Zijlstra wrote:
> > On Wed, Aug 23, 2017 at 11:12:17AM +0900, Byungchul Park wrote:
> >
> > > > > We have to detect dependecies if it exists, even in the following case:
> > > > >
> > > > > oooooooiiiiiiiiiiiiiiiiiii.........
> > > > > |<- range for commit ->|
> > > > >
> > > > > where
> > > > > o: acquisition outside of each work,
> > > > > i: acquisition inside of each work,
> > > > >
> > > > > With yours, we can never detect dependecies wrt 'o'.
> > > >
> > > > There really shouldn't be any o's when you call
> > >
> > > There can be any o's.
> >
> > Yes, but they _must_ be irrelevant, see below.
>
> No, they can be relevant, see below.

I meant we have to detect problems like, just for example:

A worker:

acquire(A)
process_one_work()
acquire(B)

crossrelease_hist_start(PROC)
work_x->func()
acquire(C)
release(C)
complete(D)
crossrelease_hist_end(PROC)

release(B)
release(A)

A task:

acquire(A)
acquire(B)
initiate work_x
wait_for_completion(D)

In this case, I want to detect a problem by creating true dependencies,
which are:

A -> B
B -> C
D -> A // You are currently trying to invalidate this unnecessarily.
D -> B // You are currently trying to invalidate this unnecessarily.
D -> C

in the worker,

B -> D

in the task.

Crossrelease should detect the problem with the following chain:

A -> B -> D -> A

or

B -> D -> B

So, please keep my original code unchanged conceptially.