freebsd-dev/share/man
Jonathan T. Looney 1067a2ba68 Consistently enforce the restriction against calling malloc/free when in a
critical section.

uma_zalloc_arg()/uma_zalloc_free() may acquire a sleepable lock on the
zone. The malloc() family of functions may call uma_zalloc_arg() or
uma_zalloc_free().

The malloc(9) man page currently claims that free() will never sleep.
It also implies that the malloc() family of functions will not sleep
when called with M_NOWAIT. However, it is more correct to say that
these functions will not sleep indefinitely. Indeed, they may acquire
a sleepable lock. However, a developer may overlook this restriction
because the WITNESS check that catches attempts to call the malloc()
family of functions within a critical section is inconsistenly
applied.

This change clarifies the language of the malloc(9) man page to clarify
the restriction against calling the malloc() family of functions
while in a critical section or holding a spin lock. It also adds
KASSERTs at appropriate points to make the enforcement of this
restriction more consistent.

PR:		204633
Differential Revision:	https://reviews.freebsd.org/D4197
Reviewed by:	markj
Approved by:	gnn (mentor)
Sponsored by:	Juniper Networks
2015-11-19 14:04:53 +00:00
..
man1 Add META_MODE support. 2015-06-13 19:20:56 +00:00
man3 Document bitset(9) 2015-10-17 19:55:58 +00:00
man4 Add the mlx5 and mlx5en modules to the i386 and amd64 kernel builds by 2015-11-19 12:55:43 +00:00
man5 Regen src.conf.5 2015-11-14 04:50:28 +00:00
man6 Add META_MODE support. 2015-06-13 19:20:56 +00:00
man7 Let SUBDIR_OVERRIDE with 'make buildworld' be more useful. 2015-10-22 00:07:48 +00:00
man8 It's 2015, and some people are still trying to use fdisk and then 2015-09-02 14:08:43 +00:00
man9 Consistently enforce the restriction against calling malloc/free when in a 2015-11-19 14:04:53 +00:00
Makefile Add more SUBDIR_PARALLEL. 2015-10-15 22:55:08 +00:00