<aside> πŸ’¬ Paging - the idead of chopping up the spaces into fixed size pieces

Two advantages: flexibility and simplicity

</aside>

<aside> πŸ’¬ Address Space Identifier, ASID - similar to PID, used to determine whether an entry on the TLB belongs to a process

</aside>

Multi-level Page Tables


  1. Chop up the page table into page-sized units
  2. If an entire page of PTE is invalid, don’t allocate that page of the page table at all
  3. Use page directory to check whether a page of the page table is valid

Untitled

The page directory, in a simple two-level table, contains one entry per page of the page table.

<aside> πŸ’¬ Page Directory Entries, PDE

Consisting of a valid bit and a page frame number (PFN)

If one PDE is valid, than at least one of the page table that the entry points to is valid

</aside>

<aside> πŸ’¬ Time and Space Trade-Offs

If you wish to make access to a particular data structure faster, you will have to pay a space-usage penalty for the stucture

</aside>

Smaller page table size results in higher cost with TLB miss

The additional level of abstraction allows us to put page-table pages wherever we like in physical memory.

Untitled

<aside> πŸ’¬ Inverted Page Tables

A single page table that has an entry for each physical page of the system.

Can be optimized with hash table

</aside>

Swaping


<aside> πŸ’¬ Swap Space - reserve some space on the disk for moving pages back and forth

</aside>

<aside> πŸ’¬ Present Bit - If the present bit is set to one, it means the page is present in physical memory and everything proceeds as usual; if it is set to zero, the page is not in memory but rather on disk somewhere. ******


Page Fault - accessing a page that is not in physical memory

Upon a page fault, the OS is invoked to service the page fault. A particular piece of code, known as a page-fault handler, runs, and must service the page fault

</aside>

<aside> πŸ’¬ Swap Daemon / Page Daemon

To keep a small amount of memory free, OS have some kind of high watermark (HW) and low watermark (LW) to help decide when to start evicting pages from memory.

When the OS notices that there are fewer than LW pages available, a background thread that is responsible for freeing memory runs. The thread evicts pages until there are HW pages available.

</aside>