mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-27 11:20:58 +01:00
Improve description for Giant and mention blocking inside interrupt threads.
This commit is contained in:
parent
184538e270
commit
d7d58009ce
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd January 29, 2010
|
||||
.Dd February 10, 2010
|
||||
.Dt LOCKING 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -191,13 +191,16 @@ Giant is an instance of a mutex, with some special characteristics:
|
||||
.It
|
||||
It is recursive.
|
||||
.It
|
||||
Drivers can request that Giant be locked around them, but this is
|
||||
going away.
|
||||
.It
|
||||
You can sleep while it has recursed, but other recursive locks cannot.
|
||||
Drivers and filesystems can request that Giant be locked around them
|
||||
by not marking themselves MPSAFE. Note that infrastructure to do this
|
||||
is slowly going away as non-MPSAFE drivers either became properly locked
|
||||
or disappear.
|
||||
.It
|
||||
Giant must be locked first before other locks.
|
||||
.It
|
||||
It is OK to hold Giant while performing unbounded sleep; in such case,
|
||||
Giant will be dropped before sleeping and picked up after wakeup.
|
||||
.It
|
||||
There are places in the kernel that drop Giant and pick it back up
|
||||
again.
|
||||
Sleep locks will do this before sleeping.
|
||||
@ -315,6 +318,9 @@ If any caller above you has any mutex or
|
||||
rwlock, your sleep, will cause a panic.
|
||||
If the sleep only happens rarely it may be years before the
|
||||
bad code path is found.
|
||||
.Pp
|
||||
It is an error to do any operation that could result in unbounded sleep when
|
||||
running inside an interrupt thread.
|
||||
.Ss Interaction table
|
||||
The following table shows what you can and can not do if you hold
|
||||
one of the synchronization primitives discussed here:
|
||||
|
Loading…
Reference in New Issue
Block a user