HomeFreeBSD

Record part of the owner struct thread pointer into busy_lock.

Description

Record part of the owner struct thread pointer into busy_lock.

Record as much bits from curthread into busy_lock as fits. Low bits
for struct thread * representation are zero due to struct and zone
alignment, and they leave space for busy flags (perhaps except
statically allocated thread0). Upper bits are not very interesting
for assert, and in most practical situations recorded value should
allow to manually identify the owner with certainity.

Assert that unbusy is performed by the owner, except few places where
unbusy is done in io completion handler. For this case, add
_unchecked variants of asserts and unbusy primitives.

Reviewed by: markj (previous version)
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D22298

Details

Provenance
kibAuthored on
Reviewer
markj
Differential Revision
D22298: Record part of the owner struct thread pointer into busy_lock.
Parents
rS355061: tmpfs: resolve deadlock between rename and unmount.
Branches
Unknown
Tags
Unknown