summaryrefslogtreecommitdiffstats
path: root/share/man
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-05-03 07:17:13 +0000
committersephe <sephe@FreeBSD.org>2016-05-03 07:17:13 +0000
commit50eba76e306f52b315e2e304800e2ac27563d1e5 (patch)
tree45a74f9502b2a5aab2e82bc6a51bb083759e6779 /share/man
parenteed4bd22add2269ccde27996035581801316c610 (diff)
downloadFreeBSD-src-50eba76e306f52b315e2e304800e2ac27563d1e5.zip
FreeBSD-src-50eba76e306f52b315e2e304800e2ac27563d1e5.tar.gz
kern: Add phashinit_flags(), which allows malloc(M_NOWAIT)
It will be used for the upcoming LRO hash table initialization. And probably will be useful in other cases, when M_WAITOK can't be used. Reviewed by: jhb, kib Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6138
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man9/hashinit.924
1 files changed, 19 insertions, 5 deletions
diff --git a/share/man/man9/hashinit.9 b/share/man/man9/hashinit.9
index 65ef10e..5357a95e 100644
--- a/share/man/man9/hashinit.9
+++ b/share/man/man9/hashinit.9
@@ -25,11 +25,11 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 23, 2016
+.Dd April 29, 2016
.Dt HASHINIT 9
.Os
.Sh NAME
-.Nm hashinit , hashinit_flags , hashdestroy , phashinit
+.Nm hashinit , hashinit_flags , hashdestroy , phashinit , phashinit_flags
.Nd manage kernel hash tables
.Sh SYNOPSIS
.In sys/malloc.h
@@ -45,12 +45,14 @@
.Fn hashdestroy "void *hashtbl" "struct malloc_type *type" "u_long hashmask"
.Ft "void *"
.Fn phashinit "int nelements" "struct malloc_type *type" "u_long *nentries"
+.Fn phashinit_flags "int nelements" "struct malloc_type *type" "u_long *nentries" "int flags"
.Sh DESCRIPTION
The
.Fn hashinit ,
-.Fn hashinit_flags
-and
+.Fn hashinit_flags ,
.Fn phashinit
+and
+.Fn phashinit_flags
functions allocate space for hash tables of size given by the argument
.Fa nelements .
.Pp
@@ -71,6 +73,12 @@ function operates like
but also accepts an additional argument
.Fa flags
which control various options during allocation.
+.Fn phashinit_flags
+function operates like
+.Fn phashinit
+but also accepts an additional argument
+.Fa flags
+which control various options during allocation.
Allocated hash tables are contiguous arrays of
.Xr LIST_HEAD 3
entries, allocated using
@@ -100,13 +108,19 @@ must be used with one of the following values.
.It Dv HASH_NOWAIT
Any malloc performed by the
.Fn hashinit_flags
+and
+.Fn phashinit_flags
function will not be allowed to wait, and therefore may fail.
.It Dv HASH_WAITOK
Any malloc performed by
.Fn hashinit_flags
+and
+.Fn phashinit_flags
function is allowed to wait for memory.
This is also the behavior of
-.Fn hashinit .
+.Fn hashinit
+and
+.Fn phashinit .
.El
.Sh IMPLEMENTATION NOTES
The largest prime hash value chosen by
OpenPOWER on IntegriCloud