54 Commits

Author SHA1 Message Date
jtl
f2aa140123 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
joel
121294362f Misc mdoc fixes:
- Remove superfluous paragraph macros.
- Remove/fix empty or incorrect macros.
- Sort sections into conventional order.
- Terminate quoted strings properly.
- Remove EOL whitespace.
2014-11-23 21:00:00 +00:00
glebius
ea976e6bb3 Remove notes about historical mbuf(9) allocator flags from documentation.
Sponsored by:	Nginx, Inc.
2014-01-16 13:58:55 +00:00
joel
b4a387db94 Remove trailing whitespace. 2012-11-16 11:56:53 +00:00
alc
8f8f99d37a M_USE_RESERVE is no longer deprecated. It is once again supported.
Reviewed by:	kib
2012-11-16 06:40:40 +00:00
kevlo
2925be1702 Put parenthesis around sizeof args. 2012-07-17 02:05:39 +00:00
eadler
1ef5fe44d3 Remove trailing whitespace per mdoc lint warning
Disussed with:	gavin
No objection from:	doc
Approved by:	joel
MFC after:	3 days
2012-03-29 05:02:12 +00:00
kmacy
072fe4a7ca update .Dd 2012-01-28 23:30:39 +00:00
kmacy
e054993274 document M_NODUMP flag 2012-01-28 17:21:12 +00:00
joel
82de4fa7ef The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-02 21:50:36 +00:00
des
66f807ed8b Retire the MALLOC and FREE macros. They are an abomination unto style(9).
MFC after:	3 months
2008-10-23 15:53:51 +00:00
ru
e8523e8018 s/M_TRYWAIT/M_WAIT/ 2008-03-25 15:44:49 +00:00
brueffer
fdf635c9c0 Xref memguard(9) 2005-02-22 17:20:20 +00:00
ru
7a3e657c56 Sort sections. 2005-01-21 08:36:40 +00:00
mpp
eaa9f15572 Spelling fixes. 2004-06-21 14:11:45 +00:00
jkoshy
3537c363d9 Cross-reference contigmalloc(9). 2004-03-06 02:13:03 +00:00
des
00e29c835f Back out previous commit due to objections. 2004-02-16 21:36:59 +00:00
des
b5f599aa9c Document the change in M_WAITOK semantics. 2004-02-16 18:46:16 +00:00
ru
1c23ef339b mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
harti
c707f7c3f3 Rename the section 'locking considerations' into 'context'.
Change the wording in this section to get rid of references to mutexes
and talk about sleeping instead.

Discussed with: jhb@, ru@
2003-06-12 09:03:15 +00:00
ru
aaa0f05b80 Assorted mdoc(7), grammar, spelling, and punctuation fixes.
Approved by:	re (blanket)
2003-05-21 15:49:01 +00:00
hmp
94f281ee94 malloc(9) types can be used to identify multiple allocations.
PR: docs/38618
Approved by: des (mentor)
2003-05-06 19:10:17 +00:00
harti
5e99ad1e4e Forced commit to fill in the fields below for the last commit. Also
bump the date of the man page.

PR:		docs/24797
Reviewed by:	bde, jake, jhb
2003-04-10 10:18:56 +00:00
harti
a90ae59dd6 Explicitely document the locking requirements for the malloc interface.
While beeing here also correct the following:

 - list missing macros in the header
 - document MALLOC_DEFINE and MALLOC_DECLARE in the SYNOPSIS section
 - document additional include requirements for MALLOC_DEFINE
 - M_NOWAIT is not 0 anymore
 - remove rotted diagnostic messages
2003-04-09 08:27:32 +00:00
trhodes
078fd34f19 Return bits which were removed in revision 1.28.
Requested by:	imp
2003-02-24 05:53:27 +00:00
charnier
837debed57 The .Fn function 2003-02-05 14:00:46 +00:00
alfred
e2a653e1d2 Catch up to WAIT/NOWAIT cleanup. 2003-01-21 08:57:35 +00:00
sheldonh
85e76830e5 Add required commas that were ommitted in the previous delta; the
SEE ALSO section's list of manual pages must be comma-separated.
2003-01-19 15:44:32 +00:00
alfred
1cdda66e68 Document lock order reversals possible when calling allocation functions
with vnode interlocks held.

Emphasize that users need to be careful with malloc flags versus mbuf
flags.

Remove stale portion in vnode.9 about v_tag.  We don't have it anylonger.

Submitted by: Hiten Pandya <hiten@unixdaemons.com>
2003-01-18 19:51:52 +00:00
rwatson
3fdcc957db Caution programmers not to confuse M_DONTWAIT with M_NOWAIT. They
are not the same.

Suggested by:	Hiten Pandya <hiten@unixdaemons.com>
2003-01-18 03:25:40 +00:00
ru
f6006b0adb Spelling: s/then/than/ where appropriate. 2002-12-24 16:52:31 +00:00
ru
e558020c07 mdoc(7) police: fixed some wording, kill whitespace at EOL. 2002-03-18 10:52:09 +00:00
archie
4ff8306186 Add realloc() and reallocf(), and make free(NULL, ...) acceptable.
Reviewed by:	alfred
2002-03-13 01:42:33 +00:00
ru
623da62a5a mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
jhb
46cf5c221a Spelling fix: depreciated -> deprecated. 2001-08-23 23:41:53 +00:00
jhb
c16b0eae5f Remove refernces to M_ASLEEP/asleep/await. 2001-08-23 23:40:53 +00:00
schweikh
511e378b14 Removed whitespace at end-of-line; no content changes. I simply did
cd src/share; find man[1-9] -type f|xargs perl -pi -e 's/[ \t]+$//'

BTW, what editors are the culprits? I'm using vim and it shows
me whitespace at EOL in troff files with a thick blue block...

Reviewed by:	Silence from cvs diff -b
MFC after:	7 days
2001-07-14 19:41:16 +00:00
ru
9001bc7070 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 15:31:11 +00:00
ru
3d96d7e52f mdoc(7) police: Removed extraneous .No call. The .Nm macro in
mdocNG has been fixed to properly handle its arguments so this
was causing the extraneous (undesirable) space.
2001-02-07 10:11:57 +00:00
ru
17ba214098 Prepare for mdoc(7)NG. 2000-12-29 09:18:45 +00:00
phk
55e86a81b7 Introduce the M_ZERO flag to malloc(9)
Instead of:

        foo = malloc(sizeof(foo), M_WAIT);
        bzero(foo, sizeof(foo));

You can now (and please do) use:

        foo = malloc(sizeof(foo), M_WAIT | M_ZERO);

In the future this will enable us to do idle-time pre-zeroing of
malloc-space.
2000-10-20 17:54:55 +00:00
sheldonh
88dd9b4faa Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-03 14:05:08 +00:00
dillon
772404948c Bring kernel malloc documentation up to date, including the example.
PR:	docs/10059
1999-09-29 16:49:18 +00:00
peter
76f0c923fe $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
nik
1c58beb04f Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 21:02:10 +00:00
mpp
9d0120cf53 Fix some typos and do some minor mdoc cleanup. 1999-06-27 02:38:46 +00:00
alex
95c394b70e Removed occurrences of consecutive repeated words (such as "the the"). 1999-02-12 02:12:08 +00:00
dillon
cd90c3c945 M_AWAIT changed to M_ASLEEP 1998-12-23 01:06:57 +00:00
dillon
f8ee3e8fee Documentation update for new M_AWAIT flag to kernel malloc, plus revamp
the descriptions of the flags and return value.
1998-12-23 01:05:06 +00:00
phk
84a8617808 Fix argument reversal in example.
PR:		7138
Reviewed by:	phk
Submitted by:	Robert Watson <robert+freebsd@cyrus.watson.org>
1998-07-02 05:37:33 +00:00