Re: [PATCH v4 15/15] lockdep: Crossrelease feature documentation
From: Boqun Feng
Date: Wed Jan 18 2017 - 01:42:14 EST
On Fri, Dec 09, 2016 at 02:12:11PM +0900, Byungchul Park wrote:
[...]
> +Example 1:
> +
> + CONTEXT X CONTEXT Y
> + --------- ---------
> + mutext_lock A
> + lock_page B
> + lock_page B
> + mutext_lock A /* DEADLOCK */
s/mutext_lock/mutex_lock
> + unlock_page B
> + mutext_unlock A
> + mutex_unlock A
> + unlock_page B
> +
> + where A is a lock class and B is a page lock.
> +
> +No, we cannot.
> +
> +Example 2:
> +
> + CONTEXT X CONTEXT Y CONTEXT Z
> + --------- --------- ----------
> + mutex_lock A
> + lock_page B
> + lock_page B
> + mutext_lock A /* DEADLOCK */
> + mutext_unlock A
Ditto.
> + unlock_page B held by X
> + unlock_page B
> + mutex_unlock A
> +
> + where A is a lock class and B is a page lock.
> +
> +No, we cannot.
> +
> +Example 3:
> +
> + CONTEXT X CONTEXT Y
> + --------- ---------
> + mutex_lock A
> + mutex_lock A
> + mutex_unlock A
> + wait_for_complete B /* DEADLOCK */
I think this part better be:
CONTEXT X CONTEXT Y
--------- ---------
mutex_lock A
mutex_lock A
wait_for_complete B /* DEADLOCK */
mutex_unlock A
, right? Because Y triggers DEADLOCK before X could run mutex_unlock().
Regards,
Boqun
Attachment:
signature.asc
Description: PGP signature