理解Linux中paging || demand paging || anticipatory paging

  • paging

    wikipedia

    In computer operating systems, paging is a memory management scheme by which a computer stores and retrieves data from secondary storage for use in main memory.

    In this shceme, the operating system retrieves data from secondary storage in same-size blocks called pages.

    Paging is an important part of virual memory implementations in modern operating systems, using secondary storage to let programs exceed the size of available physical memory.

    main memory is called “RAM”(an acronym of “random - access memory”) and secondary storage is called “disk” (a shorthand for “hard disk drive, drum memory or solid-state drive”)

  • pages

    pages became the units exchanged between disk and RAM.

    A page, memory page, or virtual page is a fixed-length contiguous block of virtual memory, described by a single entry in the page table.

    It is the smallest unit of data for mamory management in a virtual memory operating system.

    Similarly, a page frame is the smallest fixed-length contiguous block of physical memory into which memory pages are mapped by the operating system.

    A transfer of pages between main memory and an auxiliary store, such as a hard disk drive, is reffered to as paging or swapping.

  • Page replacement techniques

    from paging, page replacement techniques:

    1. demand paging

      Refered from wikipedia, demand paging (as opposed to anticipatory paging) is a method of virtual memory management.

      The OS copies a disk page into physical memory only if an attempt is made to access it and that page is not already in memory.

      It is an example of a lazy loading technique.

    2. anticipatory paging

      Also called swap prefetch, predicts which pages will be references soon, to minimize future page faults.

    3. free page queue, stealing, and reclamation
    4. pre-cleaning
  • 前情回顾

    从上文可见,想要理解paging,需要先理解:

    • 《理解Linux中secondary storage》
    • 《理解Linux中virtual memory 》
    • 《理解Computer中Address space\MMU\PTE\TLB\Page table\Page out》
  • 其他主题

    • thrashing

你可能感兴趣的:(Linux)