<< Chapter < Page | Chapter >> Page > |
Let:
then
If there a multiple classes of memory accesses, such as no disk access, one disk access, and two disk access, then you wouldhave a fraction (h) and access time (t) for each class of access.
Note that this calculation is the same type that computer architects use to calculate memory performance. In that case, theiraccess classes might be (1) cached in L1, (2) cached in L2, and (3) RAM.
Once the hardware has provided basic capabilities for virtual memory, the OS must make two kinds of scheduling decisions:
Page selection Algorithms:
Page Replacement Algorithms:
Example: Try the reference string A B C A B D A D B C B, assume there are three page frames of physical memory. Show the memoryallocation state after each memory reference.
Note that MIN is optimal (cannot be beaten), but that the principle of locality states that past behavior predicts futurebehavior, thus LRU should do just about as well.
Implementing LRU: need some form of hardware support, in order to keep track of which pages have been used recently.
This is an efficient way to approximate LRU.
Clock algorithm: keep "use" bit for each page frame, hardware sets the appropriate bit on every memory reference. The operatingsystem clears the bits from time to time in order to figure out how often pages are being referenced. Introduce clock algorithm where to find a page to throwout the OS circulates through the physical frames clearing use bits until one is found that is zero. Use that one. Show clock analogy.
Notification Switch
Would you like to follow the 'Operating systems' conversation and receive update notifications?