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
..
2015-08-12 11:56:19 +00:00
2015-10-20 23:48:14 +00:00
2012-05-20 16:43:47 +00:00
2013-03-04 19:10:39 +00:00
2015-01-07 16:15:00 +00:00
2015-10-20 23:52:37 +00:00
2013-04-20 12:36:53 +00:00
2014-11-23 21:00:00 +00:00
2012-05-20 16:43:47 +00:00
2015-08-12 11:56:19 +00:00
2015-06-13 19:20:56 +00:00
2014-12-26 01:48:44 +00:00
2015-08-28 00:12:59 +00:00
2014-07-23 18:54:18 +00:00
2015-08-12 11:56:19 +00:00
2015-08-12 11:56:19 +00:00
2013-08-25 06:58:51 +00:00
2014-05-04 12:32:37 +00:00
2012-01-19 09:51:07 +00:00
2015-01-27 09:48:02 +00:00
2014-07-18 06:56:24 +00:00
2015-11-19 05:50:22 +00:00
2015-05-19 15:43:20 +00:00
2015-07-16 15:43:55 +00:00
2012-07-04 07:42:12 +00:00
2015-06-18 16:29:11 +00:00
2014-11-23 21:00:00 +00:00
2014-07-17 23:23:01 +00:00
2015-06-18 16:29:11 +00:00
2012-01-19 09:51:07 +00:00
2012-01-19 09:51:07 +00:00
2010-07-31 10:01:15 +00:00
2013-10-07 20:29:31 +00:00
2012-05-20 16:43:47 +00:00
2012-05-20 16:43:47 +00:00