Re: [PATCH 4/4] lockdep: Fix workqueue crossrelease annotation
From: Peter Zijlstra
Date: Tue Sep 05 2017 - 06:52:50 EST
On Tue, Sep 05, 2017 at 07:31:44PM +0900, Byungchul Park wrote:
> Let me show you a possible scenario with a leaf lock:
>
> lock(A)
> lock(A) wait_for_completion(B)
> unlock(A) ...
> ... unlock(A)
> process_one_work()
> work->func()
> complete(B)
>
> It's a deadlock by a lead lock A and completion B.
By having wait_for_completion() in it, A is not a leaf lock.