Re: INFO: possible circular locking dependency atcleanup_workqueue_thread

From: Oleg Nesterov
Date: Tue May 19 2009 - 10:58:21 EST


On 05/19, Peter Zijlstra wrote:
>
> > There is a solution to this, Gautham suggested it a while back, we could
> > make lockdep scan a lock (Z) his dependencies and if in every chain a
> > particular other lock (L2) was taken, ignore this lock (Z) his
> > dependency for the circular analysis at hand.
> >
> > That would mean we would not find the Z->L1 dep to violate the existing
> > one, because we would ignore L2->Z (because in every Z we hold L2), and
> > we would indeed fail on the next: L2->L1 on the next line in your
> > initial program.
> >
> > Implementing this however might be slightly less trivial than this
> > explanation -- it would however rid us of the spin_lock_nest_lock()
> > annotation's need.
>
> Ingo pointed out that that would weaken the possible deadlock detection
> in that it would have to observe a Z outside of L2 before reporting the
> problem, which might be a very rare, but existing, code path.
>
> Another possible way might be to find the smallest cycle instead of just
> any (the first) cycle.

Yes, thanks Peter for your explanations. Not that I fully understand them,
but at least I do understand this is not trivial.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/