User:Mkstreic/sandbox

In computer engineering Directory System Management refers to various methods used to implement directory-based coherence protocols. These methods can be used to target both performance and scalability of directory systems.

Full Bit Vector Format
Full Bit Vector format is the simplest structure to implement, but the least scalable. For each possible cache line in memory, a bit is used to track whether every individual processor has that line stored in it's cache. The SGI origin 2000 uses a combination of full bit vector and coarse bit vector.

Storage Requirements
Each cache line must have 1 bit stored per processor per cache line, along with bits for tracking the state the directory. This leads to the total size required being (Number of Processors)*number of cache lines, having a storage overhead ratio of (Number of Processors)/(Cache Block Size*8). It can be observed that directory overhead scales linearly with the number of processors. While this may be fine for small numbers of processors, when implemented in large systems the size requirements for the directory become excessive. For example, with a block size of 64 bytes and 1024 caches, the storage overhead ratio becomes 1024/(64*8) = 200%.

Coarse Bit Vector Format
The Coarse Bit Vector Format has a similar structure to the full bit vector format, improving size requirements at the expense of bus traffic. Rather than tracking on bit per processor for every cache line, the directory groups several processors into nodes, storing whether a cache line is stored in a node rather then a line, saving (processors per node)*(total lines). Thus the ratio overhead is the same, just replacing number of processors with number of processor groups. When a bus request is made for a cache line that one processor in the group has, the directory broadcasts the signal into every processor in the node rather then just the caches that contain it, leading to unnecessary traffic to nodes that don't have the data cached.

Limited Pointer Format
The Limited Pointer Format uses a set number of pointers to track the processors that are caching the data. When a new processor caches a block, a free pointer is chosen from a pool to point to that processor. There are a few options for handling cases when the number of sharers exceeds the number of free pointers. One method is to invalidate one of the sharers, using it's pointer for the new requestor, though this can be costly in cases where a block has a large number of readers, such as a lock. Another method is to have a separate pool of free pointers available to all the blocks. This method is usually effective as the number of blocks shared by a large number of processors is not normally very large.