Gontents xv 93 VM as a Tool for Caching 805 9.3.1 DRAM Cache Organization 806 9.3.2 Page Tables 806 9.3.3 Page Hits,808 9.3.4 Page Faults808’ 9.3.5 Allocating Pages 810 9.3.6 Locality to the Rescue Again 810 9.4 VM as a Tool for Memory Management 811 9.5 VM as a Tool for Memory Protection .812 9.6 Address Translation 813 .I 9.6.1 Integrating Caches and VM 817 9.6.2 Speeding Up Address Translation with a TLB 817 9.6.3 Multi-Level Page Tables 819 9.6.4 Putting It Together:End-to-End Address Translation 821 9.7 Case Study:The Intel Core i7/Linux Memory System 825 9.7.1 Core i7 Address Translation 826 9.7.2 Linux Virtual Memory System 828 9.8 Memory Mapping 833 9.8.1 Shared Objects Revisited 833 9.8.2 The fork Function Revisited 836 9.8.3 The execve Function Revisited 836 9.8.4 User-Level Memory Mapping with the mmap Function 837 9.9 Dynamic Memory Allocation 839 9.9.1 The malloc and free Functions 840 1 9.9.2 Why Dynamic Memory Allocation?843 9.9.3 Allocator Requirements and Goals 844 9.9.4 Fragmentation 846 9.9.5 Implementation Issues 846 1 9.9.6 Implicit Free Lists 847 9.9.7 Placing Allocated Blocks 849 9.9.8 Splitting.Free Blocks 849 9.9.9 Getting Additional Heap Memory 850 9.9.10 Coalescing Free Blocks 850 9.9.11 Coalescing with Boundary Tags 851 9.9.12 Putting It Together:Implementing a Simple Allocator 854 9.9.13 Explicit Free Lists 862 9.9.14 Segregated Free Lists 863 9.10 Garbage Collection 865' 9.10.1 Garbage Collector Basics 866 9.10.2 Mark&Sweep Garbage Collectors 867 二 9.10.3 Conservative Mark&Sweep for C Programs 8699.3 VM as a Tool f6r Caching 805 9.3.1 DRAM Cache Organization 806 9.3.2 Page Tables 806 9.3.3 Page Hits, 808 9.3.4 Page Faults 808- 1 9.3.5 Allocating Pages 810 9.3.6 Locality to the Rescue Again 810 9.4 VM as \I Tool fdr Memory Management 811 9.5 VM as a Tool for Mem'ofy Protection .812 9.6 Address Translation 813 9.6.l Integrati~g Caches andYM 817 9.6.2 Speeding Up Address 'Ifanslation with a TLB 817 9.6.3 Multi-Level Page Tables 819 ( ' 9.6.4 Putting It Together: End-to-End Addrl',s~ Trapslation ~21 9.7 Case Study: The Intel Core i7/Linux Memory System 825 9.7.1 Core i7 Address Translation 826 9.7.2 Linux Virtual Memory System 828 9.8 Memory Mapping 833 9.8.1 Shared Objects Revisited 833 9.8.2 The fork Function Revisited 836 9.8.3 The execve Function Revisited 836 9.8.4 User-Level Memory Mapping with the mmap Function 837 9.9 Dynamic Memory Alloqtion 839 9.9.l 9.9.2 9.9.3 9.9.4 9.9.5 9.9.6 9.9.7 9.9.8 9.9.9 9.9.10 9.9.11 9.9.12 9.9.13 9.9.14 The malloc and free Functions ~40 Why Dynamic Memory Allocation? 843 Allocator Requirements and Goals 844 Fragmentation 846 Implementation Issues 846 Implicit Free Lists 847 Pl~cing Allocated Blocks 849 Splitting· Free Blocks -849' 1 L ' Getting Additional Heap Memory '850 Coalescing Free Blocks 850 Coalescing with Boundary Tags 851 Putting It Together: Implementing a Simple Allocator Explicit Free Lists 862 S_egregated Free Lists 863 9.10 Garbage Collection 865' 9.10.l Garbage Collector Basics 866 9.10.2 Mark&Sweep Garbage Collectors 867 · • 9.10.3 Conservative Mark&Sweep for C Programs 869 ., " 854 h ' I .. ~ .. Gontents xv