Changes between Version 5 and Version 6 of Commentary/Rts/Storage


Ignore:
Timestamp:
Sep 12, 2006 2:58:09 PM (8 years ago)
Author:
simonmar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Rts/Storage

    v5 v6  
    4242[[Image(sm-block.png)]] 
    4343 
    44 We currently have megablocks of 1Mb in size (m = 20) with blocks of 4k in size (k = 12), and these sizes are easy to change  ([[GhcFile(includes/Constants.h)]]).  Block descriptors are currently 32 or 64 bytes depending on the word size (d = 5 or 6). 
     44We currently have megablocks of 1Mb in size (m = 20) with blocks of 4k in size (k = 12), and these sizes are easy to change  ([[GhcFile(includes/Constants.h)]]).   
    4545 
    46 So the block allocator has a little more structure: 
     46Block descriptors are currently 32 or 64 bytes depending on the word size (d = 5 or 6).  The block descriptor itself is  
     47the structure `bdescr` defined in [[GhcFile(includes/Block.h)]], and that file also defines the `Bdescr()` macro. 
     48 
     49The block allocator has a the following structure: 
    4750 
    4851 * At the bottom, talking to the OS, is the megablock allocator ([[GhcFile(rts/MBlock.c)]], [[GhcFile(rts/MBlock.h)]]). 
     
    5760 * Sitting on top of the megablock allocator is the block layer ([[GhcFile(includes/Block.h)]], [[GhcFile(rts/BlockAlloc.c)]]). 
    5861   This layer is responsible for providing: 
    59    * `void *allocGroup(int)` 
    60    * `void freeGroup(void *)` 
    61    These functions allocate and deallocate a block ''group'': a contiguous sequence of blocks (the degenerate, and common, case 
    62    is a single block).  The block allocator is responsible for keeping track of free blocks.  Currently it does this by 
    63    maintaining an ordered (by address) list of free blocks, with contiguous blocks coallesced.  However this is certanly 
    64    not optimal, and has been shown to be a bottleneck in certain cases - improving this allocation scheme would be good. 
     62{{{ 
     63   void *allocGroup(int) 
     64   void freeGroup(void *) 
     65}}} 
     66  These functions allocate and deallocate a block ''group'': a contiguous sequence of blocks (the degenerate, and common, case 
     67  is a single block).  The block allocator is responsible for keeping track of free blocks.  Currently it does this by 
     68  maintaining an ordered (by address) list of free blocks, with contiguous blocks coallesced.  However this is certanly 
     69  not optimal, and has been shown to be a bottleneck in certain cases - improving this allocation scheme would be good. 
    6570 
    6671== The Garbage Collector ==