From 40e4089d343aa9aa7ffd172dd74133b47ffbdefe Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 19 Jul 2007 17:23:20 +0000 Subject: Document support for M_NOWAIT by the new implementation of contigmalloc(9) in HEAD. Approved by: re (hrs) Reviewed by: Michael Plass --- share/man/man9/contigmalloc.9 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'share/man/man9/contigmalloc.9') diff --git a/share/man/man9/contigmalloc.9 b/share/man/man9/contigmalloc.9 index 361e44ea24be..f0797be61276 100644 --- a/share/man/man9/contigmalloc.9 +++ b/share/man/man9/contigmalloc.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2004 +.Dd July 19, 2007 .Dt CONTIGMALLOC 9 .Os .Sh NAME @@ -77,7 +77,14 @@ behaviour as follows: .Bl -tag -width indent .It Dv M_ZERO Causes the allocated physical memory to be zero filled. +.It Dv M_NOWAIT +Causes +.Fn contigmalloc +to return +.Dv NULL +if the request cannot be immediately fulfilled due to resource shortage. .El +.Pp Other flags (if present) are ignored. .Pp The @@ -88,10 +95,11 @@ function deallocates memory allocated by a previous call to The .Fn contigmalloc function does not sleep waiting for memory resources to be freed up, -but instead scans available physical memory a small number of times -for a suitably sized free address range before giving up. -Memory allocation is done on a first-fit basis, starting from the -top of the provided address range. +but instead actively reclaims pages before giving up. +However, unless +.Dv M_NOWAIT +is specified, it may select a page for reclamation that must first be +written to backing storage, causing it to sleep. .Sh RETURN VALUES The .Fn contigmalloc -- cgit v1.3