21. Swapping Mechanisms Flashcards
What is swap space?
A reserved area in the hard disk that stores memory pages that have been swapped out of memory.
What physical component do we need for swapping?
Computer hard disk
What is the present bit used for?
To determine if the page is available in physical memory
What is page fault?
The act of accessing a page that is not in physical memory
What handler is called when a page is not present?
Page-fault handler
What happens when a page is not present?
The OS will call the page-fault handler, which indexes the address in the PTE. Then it issues a I/O request to retrieve the data from the disk, marks the page as present and update the new address in the PTE.
The next step will result in a TLB miss and finally proceed like normal after that
What state will the process be in during the page fault process?
Blocked state
What happens when the memory is full during a potential swap process?
The OS has to page out first then page in.
What is page-replacement policy?
Policies that evict pages that are currently in memory
What are the possibilities when a TLB miss occurs?
- Present and valid bit - regular TLB miss handler
- Not present and valid - page fault handler then regular TLB miss handler
- Present and invalid - trap handler (invalid access)
- Not present and invalid - trap handler (invalid access)
What is low watermark and high watermark
When the OS notices there are less than low watermark pages available in memory, it evicts pages until there are at least high watermark pages available
What is a swap daemon
A background thread that evicts pages in memory to make space