Chapter 49: Memory Mappings

This chapter discusses the use of the mmap() system call to create memory mappings. Among other topics, we consider four general uses of memory mappings:
  • allocating process-private memory (private anonymous mappings);
  • initializing the contents of the text and initialized data segments of a process (private file mappings);
  • performing IPC by sharing sharing memory between processes related via fork() (shared anonymous mappings); and
  • performing memory-mapped I/O, optionally combined with memory sharing (and thus IPC) between unrelated processes (shared file mappings).
49 Memory Mappings
49.1 Overview
49.2 Creating a Mapping: mmap()
49.3 Unmapping a Mapped Region: munmap()
49.4 File Mappings
      49.4.1 Private (MAP_PRIVATE) File Mappings
      49.4.2 Shared (MAP_SHARED) File Mappings
      49.4.3 Boundary Cases
      49.4.4 Memory Protection and File Access Mode Interactions
49.5 Synchronizing a Mapped Region: msync()
49.6 Additional mmap() Flags
49.7 Anonymous Mappings
49.8 Remapping a Mapped Region: mremap()
49.9 The MAP_NORESERVE Flag and Swap Space Overcommitting
49.10 The MAP_FIXED Flag
49.11 Nonlinear Mappings: remap_file_pages()
49.12 Summary
49.13 Exercises

No comments:

Post a Comment