Operating system - virtual memory, file system interface

  • Advantages: logical address space can be larger than physical, can be shared by multiple processes, efficient process creation
  • On-demand paging: Advantages: can reduce I/O, reduce memory usage, and fast response time
    • Valid bit (physical memory) invalid bit (virtual memory) distinguishes whether it is in virtual memory
  • Page fault: Accessed page not in memory
    • Solution: Check whether the internal page table reference of the process is legal, if it is legal, it will be transferred into memory, and if it is not legal, the process will be terminated
    • The free buffer pool allocates free pages
  • Page Replacement: On-Demand Paging Basics, Separate Logical and Physical Memory
    • Algorithm optimization: modify bit, page buffer
    • Algorithm Metrics: Minimizing Page Fault Occurrences
      • FIFO: There is a Belady exception (the physical frame increases and the page fault increases instead)
      • optimal replacement
      • LRU: stack, counter implementation (increase access, memory usage, need to search all page tables every time)
      • Approximate LRU: reference bit, second chance, enhanced second chance
      • Based on count:
  • Physical frame allocation: average, ratio, priority
    • Global Replacement, Local Replacement
  • Thrashing: A process frequently page faults. As a result, the CPU usage rate drops, and the process grabs the frames of other processes
  • Operations on files on disk: direct operations, memory mapping
  • Kernel memory allocation: bluddy allocation (multiples of 2), slab allocation (one or more pages, cache has multiple slabs)
  • File concept: It is the smallest allocation unit of logical external storage, roughly divided into data and programs. Genuine types have different structures
    • Properties: name, identifier, type, location, size, protection, time
    • System open file table, process open file table

      • File pointers, open counters, disk locations, access permissions
    • Locking: shared lock/private lock, the operating system can force or suggest locking
  • Access method: sequential, direct, indexed
  • directory structure (volume: a large chunk of space where the file system is stored)
    • Single-layer, double-layer, tree-like (forbidden to share file directories), acyclic graph (implementation: symbolic link, non-symbolic link), general graph
  • File system installation: the operating system needs to know the device name, installation location
  • File sharing: via FTP\distributed file system, browser
    • Remote file system failure and local file system failure add new failure modes and record status information
  • File Consistency Semantics and Protection

 

Guess you like

Origin blog.csdn.net/qq_56061892/article/details/126224171