
<p><strong>Data Storage </strong></p><p>Disks </p><p>•••</p><p>Hard disk (HDD) </p><p>•</p><p>Solid state drive (SSD) </p><p>•</p><p>Random Access Memory </p><p>Dynamic RAM (DRAM) </p><p>•</p><p>Static RAM (SRAM) </p><p>•</p><p>Registers </p><p>%rax, %rbx, ... </p><p>•</p><p></p><ul style="display: flex;"><li style="flex:1">Sean Barker </li><li style="flex:1">1</li></ul><p></p><p><strong>The CPU-Memory Gap </strong></p><p>100,000,000.0 <br>10,000,000.0 <br>1,000,000.0 <br>100,000.0 <br>10,000.0 <br>1,000.0 <br>100.0 </p><p><strong>Disk </strong><br><strong>SSD </strong></p><p>Disk seek time SSD access time DRAM access time SRAM access time CPU cycle time </p><p><strong>DRAM </strong></p><p>10.0 <br>Effective CPU cycle time </p><p>1.0 </p><p><strong>CPU </strong></p><p>0.1 0.0 <br>1985 1990 1995 2000 2003 2005 2010 2015 </p><p><strong>Year </strong></p><p></p><ul style="display: flex;"><li style="flex:1">Sean Barker </li><li style="flex:1">2</li></ul><p></p><p><strong>Caching </strong></p><p><strong>Smaller, faster, more expensive memory caches a subset of the blocks </strong></p><p></p><ul style="display: flex;"><li style="flex:1"><strong>84 </strong></li><li style="flex:1"><strong>9</strong></li><li style="flex:1"><strong>104 </strong></li><li style="flex:1"><strong>3</strong></li></ul><p></p><p><strong>Cache </strong></p><p><strong>Data is copied in block-sized transfer units </strong></p><p><strong>140 </strong></p><p><strong>Larger, slower, cheaper memory viewed as par@@oned into “blocks” </strong></p><p><strong>04</strong><br><strong>15</strong><br><strong>26</strong><br><strong>3</strong></p><p><strong>Memory </strong></p><p><strong>7</strong></p><ul style="display: flex;"><li style="flex:1"><strong>8</strong></li><li style="flex:1"><strong>9</strong></li><li style="flex:1"><strong>10 </strong></li></ul><p><strong>14 </strong><br><strong>11 </strong></p><ul style="display: flex;"><li style="flex:1"><strong>15 </strong></li><li style="flex:1"><strong>12 </strong></li><li style="flex:1"><strong>13 </strong></li></ul><p></p><p></p><ul style="display: flex;"><li style="flex:1">Sean Barker </li><li style="flex:1">3</li></ul><p></p><p><strong>Cache Hit </strong></p><p><strong>Request: 14 </strong></p><p></p><ul style="display: flex;"><li style="flex:1"><strong>8</strong></li><li style="flex:1"><strong>9</strong></li><li style="flex:1"><strong>14 </strong></li><li style="flex:1"><strong>3</strong></li></ul><p></p><p><strong>Cache </strong></p><p><strong>04</strong><br><strong>15</strong><br><strong>26</strong><br><strong>3</strong></p><p><strong>Memory </strong></p><p><strong>7</strong></p><ul style="display: flex;"><li style="flex:1"><strong>8</strong></li><li style="flex:1"><strong>9</strong></li><li style="flex:1"><strong>10 </strong></li></ul><p><strong>14 </strong><br><strong>11 </strong></p><ul style="display: flex;"><li style="flex:1"><strong>15 </strong></li><li style="flex:1"><strong>12 </strong></li><li style="flex:1"><strong>13 </strong></li></ul><p></p><p></p><ul style="display: flex;"><li style="flex:1">Sean Barker </li><li style="flex:1">4</li></ul><p></p><p><strong>Cache Miss </strong></p><p><strong>Request: 12 </strong></p><p></p><ul style="display: flex;"><li style="flex:1"><strong>8</strong></li><li style="flex:1"><strong>192 </strong></li><li style="flex:1"><strong>14 </strong></li><li style="flex:1"><strong>3</strong></li></ul><p></p><p><strong>Cache </strong></p><p><strong>Request: 12 </strong></p><p><strong>12 </strong><br><strong>04</strong><br><strong>15</strong><br><strong>26</strong><br><strong>3</strong></p><p><strong>Memory </strong></p><p><strong>7</strong></p><ul style="display: flex;"><li style="flex:1"><strong>8</strong></li><li style="flex:1"><strong>9</strong></li><li style="flex:1"><strong>10 </strong></li></ul><p><strong>14 </strong><br><strong>11 </strong></p><ul style="display: flex;"><li style="flex:1"><strong>15 </strong></li><li style="flex:1"><strong>12 </strong></li><li style="flex:1"><strong>13 </strong></li></ul><p></p><p></p><ul style="display: flex;"><li style="flex:1">Sean Barker </li><li style="flex:1">5</li></ul><p></p><p><strong>Locality </strong></p><p>¢ꢀ <strong>Temporal locality: </strong>¢ꢀ <strong>Spa0al locality: </strong></p><p></p><ul style="display: flex;"><li style="flex:1">Sean Barker </li><li style="flex:1">6</li></ul><p></p><p><strong>Locality Example (1) </strong></p><p><strong>sum = 0; for (i = 0; i < n; i++) sum += a[i]; return sum; </strong></p><p></p><ul style="display: flex;"><li style="flex:1">Sean Barker </li><li style="flex:1">7</li></ul><p></p><p><strong>Locality Example (2) </strong></p><p><strong>int sum_array_rows(int a[M][N]) { int i, j, sum = 0; </strong></p><p><strong>for (i = 0; i < M; i++) for (j = 0; j < N; j++) sum += a[i][j]; return sum; </strong><br><strong>}</strong></p><p></p><ul style="display: flex;"><li style="flex:1">Sean Barker </li><li style="flex:1">8</li></ul><p></p><p><strong>Locality Example (3) </strong></p><p><strong>int sum_array_cols(int a[M][N]) { int i, j, sum = 0; </strong></p><p><strong>for (j = 0; j < N; j++) for (i = 0; i < M; i++) sum += a[i][j]; return sum; </strong><br><strong>}</strong></p><p></p><ul style="display: flex;"><li style="flex:1">Sean Barker </li><li style="flex:1">9</li></ul><p></p><p><strong>The Memory Hierarchy </strong></p><p><strong>Smaller </strong></p><p><strong>Faster </strong></p><p><strong>Costlier per byte </strong></p><p><strong>On Chip Storage </strong></p><p><strong>1 cycle to access </strong><br><strong>Registers </strong></p><p><strong>CPU instrs can directly access </strong></p><p><strong>L1, L2 </strong></p><p><strong>Cache(s) (SRAM) </strong></p><p><strong>~10’s of cycles to access </strong></p><p><strong>Main memory </strong><br><strong>(DRAM) </strong></p><p><strong>~100 cycles to access </strong></p><p><strong>Larger </strong></p><p><strong>Flash SSD / Local network </strong></p><p><strong>Slower </strong></p><p><strong>Cheaper </strong></p><p><strong>per byte </strong></p><p><strong>~100 M cycles to access </strong></p><p><strong>Local secondary storage (disk) </strong></p><p><strong>slower than local </strong></p><p><strong>disk to access </strong></p><p><strong>Remote secondary storage </strong><br><strong>(tapes, Web servers / Internet) </strong></p><p></p><ul style="display: flex;"><li style="flex:1">Sean Barker </li><li style="flex:1">10 </li></ul><p></p>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages5 Page
-
File Size-