Print this page
5513 KM_NORMALPRI should be documented in kmem_alloc(9f) and kmem_cache_create(9f) man pages
14465 Present KM_NOSLEEP_LAZY as documented interface
Change-Id: I002ec28ddf390650f1fcba1ca94f6abfdb241439
@@ -97,13 +97,27 @@
available.
KM_NOSLEEP
Return NULL immediately if memory is not
- available.
+ available, but after an aggressive
+ reclaiming attempt. Any mention of
+ KM_NOSLEEP without mentioning
+ KM_NOSLEEP_LAZY (see below) applies to
+ both values.
+ KM_NOSLEEP_LAZY
+ Return NULL immediately if memory is not
+ available, without the aggressive
+ reclaiming attempt. This is actually two
+ flags combined: (KM_NOSLEEP |
+ KM_NORMALPRI), the latter flag indicating
+ not to attempt reclamation before giving
+ up and returning NULL.
+
+
KM_PUSHPAGE
Allow the allocation to use reserved
memory.
@@ -515,13 +529,15 @@
object_cache = kmem_cache_create(...);
kmem_cache_set_move(object_cache, object_move);
RETURN VALUES
- If successful, the constructor function must return 0. If KM_NOSLEEP is
- set and memory cannot be allocated without sleeping, the constructor
- must return -1.
+ If successful, the constructor function must return 0. If KM_NOSLEEP or
+ KM_NOSLEEP_LAZY is set and memory cannot be allocated without sleeping,
+ the constructor must return -1. If the constructor takes extraordinary
+ steps during a KM_NOSLEEP construction, it may not take those for a
+ KM_NOSLEEP_LAZY construction.
kmem_cache_create() returns a pointer to the allocated cache.