transistor and one capacitor Facts: 1. Each DRAM cell must be refreshed every 64 ms or less 2. It takes time for RAS and CAS to organize access to cells. 3. Cells need time to return or update value because of 4. capacitor latency.
it supply data to CPU or DMA. 2. Modern CPUs are fast. 3. Now system bus is 64 bits wide. Transfer rate = 8 bytes/transfer × 100 MHz × 4 transfers/cycle = 3200 MB/s AMD HyperTransport and Intel QuickPath Interconnect are used in modern PC
variants with four transistors but they have disadvantages. • the cell state is stable, no refresh cycles are needed. • L1 Cache size is usually 1000 times less than Memory size • The CPU core is no longer directly connected to the main memory. • When a small memory content is needed by the processor the entire cache line is loaded into the L1d. Cache Line = 64 bytes. It takes 8 bus operations to fill cache line. Static RAM
L2 ~14 Main Memory ~240 Wait state. CPU generally run much faster than the computer's other subsystems. There are tricks to supply data fast enough: • memory prefetch; • branch prediction; • instructions reordering (by compiler); • hyper threading.
L1d for data at address. 2. L1d asks for L2 for data. 3. L3 asks system bus for data. 4. If Core2 L3 has that data - it returns, otherwise memory should fullfit the request. WRITE behaviors: • write-through cache implementation; • write-back cache implementation.
coherency protocol (Modified, Exclusive, Shared, Invalid): • Invalid: The cache line is invalid, i.e., unused. • Exclusive: The cache line is not modified but known to not be loaded into any other processor's cache. • Shared: The cache line is not modified and might exist in another processor's cache. • Modified: The local processor has modified the cache line. This also implies it is the only copy in any cache.
Sequential read from memory is also fast; • Writing to the same address by multiple threads will lead to contention; • False sharing. Cache Oblivious Algorithms (if working set is large - split it to smaller part first, make operation and then join parts) Specialized CPU instructions
• Gallery of Processor Cache Effects http://igoro.com/archive/gallery-of-processor-cache-effects/ https://medium.com/@minimarcel/effect-of-cpu-caches-57db81490a7f • Wikipedia