Re: [PATCH v4 15/15] lockdep: Crossrelease feature documentation

Boqun Feng
2017-01-18T06:42:08Z

[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]