Sleeping and Non-Sleeping Allocations
Unlike the Standard C Library's
malloc
(3C) function, the kernel memory allocator can block (or sleep), waiting until enough virtual memory is available to satisfy the client's request. This is controlled by the flag
parameter to
kmem_alloc
(9F). A call to kmem_alloc
() that has the KM_SLEEP
flag set can never fail; it will block forever waiting for resources to become available.