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

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man9f/kmem_cache_create.9f.man.txt
          +++ new/usr/src/man/man9f/kmem_cache_create.9f.man.txt
↓ open down ↓ 91 lines elided ↑ open up ↑
  92   92         kmflag
  93   93                        Possible flags are:
  94   94  
  95   95                        KM_SLEEP
  96   96                                       Allow sleeping (blocking) until memory is
  97   97                                       available.
  98   98  
  99   99  
 100  100                        KM_NOSLEEP
 101  101                                       Return NULL immediately if memory is not
 102      -                                     available.
      102 +                                     available, but after an aggressive
      103 +                                     reclaiming attempt.  Any mention of
      104 +                                     KM_NOSLEEP without mentioning
      105 +                                     KM_NOSLEEP_LAZY (see below) applies to
      106 +                                     both values.
 103  107  
 104  108  
      109 +                      KM_NOSLEEP_LAZY
      110 +                                     Return NULL immediately if memory is not
      111 +                                     available, without the aggressive
      112 +                                     reclaiming attempt.  This is actually two
      113 +                                     flags combined: (KM_NOSLEEP |
      114 +                                     KM_NORMALPRI), the latter flag indicating
      115 +                                     not to attempt reclamation before giving
      116 +                                     up and returning NULL.
      117 +
      118 +
 105  119                        KM_PUSHPAGE
 106  120                                       Allow the allocation to use reserved
 107  121                                       memory.
 108  122  
 109  123  
 110  124  
 111  125         obj
 112  126                        Pointer to the object allocated by kmem_cache_alloc().
 113  127  
 114  128  
↓ open down ↓ 395 lines elided ↑ open up ↑
 510  524  
 511  525  
 512  526         To register a move() callback:
 513  527  
 514  528  
 515  529           object_cache = kmem_cache_create(...);
 516  530           kmem_cache_set_move(object_cache, object_move);
 517  531  
 518  532  
 519  533  RETURN VALUES
 520      -       If successful, the constructor function must return 0. If KM_NOSLEEP is
 521      -       set and memory cannot be allocated without sleeping, the constructor
 522      -       must return -1.
      534 +       If successful, the constructor function must return 0. If KM_NOSLEEP or
      535 +       KM_NOSLEEP_LAZY is set and memory cannot be allocated without sleeping,
      536 +       the constructor must return -1.  If the constructor takes extraordinary
      537 +       steps during a KM_NOSLEEP construction, it may not take those for a
      538 +       KM_NOSLEEP_LAZY construction.
 523  539  
 524  540  
 525  541         kmem_cache_create() returns a pointer to the allocated cache.
 526  542  
 527  543  
 528  544         If successful, kmem_cache_alloc() returns a pointer to the allocated
 529  545         object. If KM_NOSLEEP is set and memory cannot be allocated without
 530  546         sleeping, kmem_cache_alloc() returns NULL.
 531  547  
 532  548  ATTRIBUTES
↓ open down ↓ 43 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX