Virtual Memory Flashcards
what is virtual memory
provides a virtualisation of the address space
each process has a private map to translate virtual addresses into non conflicting physical addresses
what are the benefits of virtual memory
we can fill physical memory with addresses appearing where we want them.
can use physical memory sensibly without having to swap
what is paging or swapping
pages are copied onto disk to free up space.
we perform paging or swapping to bring them into main memory
this is controlled by the scheduler
what is the memory management unit
the hardware that implements memory mapping
a 64 bit machine can address
2^64 locations
what is a page
a division of a virtual memory system. the address space is divided into pages of a fixed size.
indivisible blocks assigned to processes
when in a page fault generated
when the virtual page is not resident in the MMU
what is the number of pages in a virtual memory system
address space / page size
what is a memory fault
an exception caused by: privilege violation page fault time out corrupt memory
what is a page state
each page in virtual memory will have its own state: unallocated allocated clean dirty swapped out
what happens after a page fault
allocate a page and fetch from disk
what does the MMU do
perform memory mapping and check privilege
what are the inputs to the MMU
virtual memory address
operation
processor privilege info
what are the outputs of the MMU
success:
physical memory address
cacheability info
not success:
no physical memory
illegal operation
privilege violation
what is a page table
specifies the translation from virtual to physical page address
what does the MMU use to translate the address
translation lookaside buffer TLB
what is TLB
one entry per page rather than address
speeds up memory mapping and works in parallel to L1 cache.
input - virtual address
output- physical address and permissions
what is a dirty bit
indicates a modification has been made
what is page eviction? what methods are there to choose a page to evict?
if the TLB is full and we get a page fault, we must choose one to evict.
random
FIFO
least recently used
what is a pinned page. give an example
a pinned page is one that cannot be evicted. An example is ISRs
what is a paging daemon
conducts tasks such as evicting clean pages, resorting pages and cleaning dirty pages
what other information does the mmu store
memory protection permissions
give two page permission flags
cacheable
write bufferable
where are page translation tables stored
in privileged memory
how do we minimise the time taken to change page tables during a context switch
switch the base pointer
how does the processor find the relevant page table
special register which is a pointer to the base of the translation table.