Review Problems for CS 30200 / ECE 46810 Exam 2 Spring 2021 Version 1.0. (In case I need to modify something.) The exam is over Chapters 13, 15, 16.1, 18.1-18.3, 21, and 22 from the textbook. http://pages.cs.wisc.edu/~remzi/OSTEP/ http://pages.cs.wisc.edu/~remzi/OSTEP/vm-intro.pdf http://pages.cs.wisc.edu/~remzi/OSTEP/vm-mechanism.pdf http://pages.cs.wisc.edu/~remzi/OSTEP/vm-segmentation.pdf http://pages.cs.wisc.edu/~remzi/OSTEP/vm-paging.pdf http://pages.cs.wisc.edu/~remzi/OSTEP/vm-beyondphys.pdf http://pages.cs.wisc.edu/~remzi/OSTEP/vm-beyondphys-policy.pdf 16. This problem is about what can be done when a process is larger than physical memory, that is, a process has more virtual pages than there are physical page frames. Assume that a process has four pages (numbered 0,1,2,3) in its virtual address space but the computer has only three physical page frames (numbered 0,1,2). The following tables show two possible sequences of referenced virtual page numbers by the running process. Write down in the empty slots below each page reference the virtual page that is loaded into each of the physical page frames just after the page reference (in other words, what does the process's page table look like just after each page reference?). Also, write down the total number of page hits and misses. Use the "Leased Recently Used" (LRU) page replacement policy in both cases, so you replace the contents of the page frame that was used the farthest back in time. Page Referenced: 0 1 2 3 0 1 2 3 Page Frame 0: 0 0 0 3 3 3 2 2 Page Frame 1: 1 1 1 0 0 0 3 Page Frame 2: 2 2 2 1 1 1 faults: x x x x x x x x # of hits = 0 # of misses = 8 Page Referenced: 0 1 0 1 2 3 2 3 Page Frame 0: Page Frame 1: Page Frame 2: faults: # of hits = # of misses = 17. Suppose a computer has 4 physical pages frames, and a process references its virtual pages (page numbers 0 through 7) in the following order: 0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1 a) Suppose the kernel uses FIFO page replacement algorithm. How many page faults would the process have? Which page references are page faults? b) Suppose the kernel uses LRU as the page replacement algorithm. How many page faults would the process have? Which page references are page faults? c) Suppose the kernel uses the optimal page replacement algorithm. How many page faults would the process have? Which page references are page faults? FIFO Page Referenced: 0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1 Page Frame 0: 0 0 0 0 5 5 5 5 5 5 5 3 3 3 3 Page Frame 1: 2 2 2 2 4 4 4 4 4 4 4 4 5 5 Page Frame 2: 1 1 1 1 6 6 6 6 6 6 6 6 6 Page Frame 3: 3 3 3 3 3 7 7 7 7 7 7 7 faults: x x x x x x x x x x LRU Page Referenced: 0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1 Page Frame 0: Page Frame 1: Page Frame 2: Page Frame 3: faults: Optimal Page Referenced: 0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1 Page Frame 0: 0 0 0 0 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 Page Frame 1: 2 2 2 2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Page Frame 2: 1 1 1 1 6 6 7 7 7 7 7 7 7 7 7 7 7 7 2 2 2 2 Page Frame 3: 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 faults: x x x x x x x x x x