Print this page
code review from Josh and Robert

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man9/vmem.9.man.txt
          +++ new/usr/src/man/man9/vmem.9.man.txt
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17       their natural hierarchical structure.
  18   18  
  19   19     Arenas
  20   20       An arena is nothing more than a set of integers.  These integers most
  21   21       commonly represent virtual addresses, but in fact they can represent
  22   22       anything at all.  For example, we could use an arena containing the
  23   23       integers minpid through maxpid to allocate process IDs.  For uses of this
  24   24       nature, prefer id_space(9F) instead.
  25   25  
  26   26       vmem_create() and vmem_destroy() create and destroy vmem arenas.  In
  27      -     order to differentiate between arenas used for adresses and arenas used
       27 +     order to differentiate between arenas used for addresses and arenas used
  28   28       for identifiers, the VMC_IDENTIFIER flag is passed to vmem_create().
  29   29       This prevents identifier exhaustion from being diagnosed as general
  30   30       memory failure.
  31   31  
  32   32     Spans
  33   33       We represent the integers in an arena as a collection of spans, or
  34   34       contiguous ranges of integers.  For example, the kernel heap consists of
  35   35       just one span: [kernelheap, ekernelheap).  Spans can be added to an arena
  36      -     in two ways: explicitly, by vmem_add(), or implicitly, by importing, as
       36 +     in two ways: explicitly, by vmem_add(); or implicitly, by importing, as
  37   37       described in Imported Memory below.
  38   38  
  39   39     Segments
  40   40       Spans are subdivided into segments, each of which is either allocated or
  41   41       free.  A segment, like a span, is a contiguous range of integers.  Each
  42   42       allocated segment [addr, addr + size) represents exactly one
  43   43       vmem_alloc(size) that returned addr.  Free segments represent the space
  44   44       between allocated segments.  If two free segments are adjacent, we
  45   45       coalesce them into one larger segment; that is, if segments [a, b) and
  46   46       [b, c) are both free, we merge them into a single segment [a, c).  The
↓ open down ↓ 48 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX