

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CMPSCI 377 Operating Systems Fall 2007
Lecturer: Emery Berger Scribes:
Memory are divided into page in which the physical address is mapped to a virtual address. Processes use virtual addresses which start at 0, and are allocated lazily onto pages.
The MMU is in charge of tranlating virtual addresses to their physical address. It maintains a page table (big hash table) to map the translations. This is unfortunately too slow when it comes to looking up the addresses, so we want the table to also be in the cache. The cache is about 100 times faster than RAM.
The alternative is a TLB which is a fully associative cache (expensive) where the size is limited. It caches the records used for page translations, the page number and the frame. The powers of 2 is used to simplify virtual to physical address translations. The virtual space size is 2m, and page size 2n. The high order m − n of the address is used to select a page, and the low order selects the offset.
Chances of a miss in the TLB is high due to its small size (8 to 2048 entries). The assumption made is once a page is touched, it will be in use for awhile. If the TLB was larger, it would improve the hit ratio and decrease average memory cost.
Every process has its own set of mapping (page hash table), meaning each process has its own associated table or TLB. When changing processes, the TLB of the old process is to be deleted, and a new TLB is created for the new process in a new table. This process is known as TLB shootdown. Note that the the old TLB are not stored in cache.
TLB thrashing occurs when it visits pages all over the place in and out between the cache and disk memory that it slows down the entire process. The working set exceeds the size of TLB.
8-2 Lecture 8: October 4
Paging allows the sharing of memory across processes, significantly reducing memory requirements. As long as all processes accessing the same single page in memory is not altering or writing into the memory, then it can be viewed (read-only) by all processes. Hence, code is always read-only while data is copy-on-write. However, sharing requires the hardware to be fast.
Static libraries in C are not shared, everyone has their own copy if more than one process uses it.
Allocate memory, use it, evict it (some memory written to disk due to lack of memory), and then reuse it.
Allocate memory by using mmap to obtain memory directly from the OS. mmapped I/O has no physical frame allocated at all until it starts to touch the pages. The address space is reserved since memory is not committed to physical memory yet meaning it is still free. Once the page is touched, it beccomes committed address space now that the physical memory is in use and is not free. Commmitting space is done lazily.
When memory is used, the page tables are updates and when contents are written, it is a dirty page.
If touching a page, may not use extra memory (read-shared), writing-used.