ICS 143 - Principles of Operating Systems Discussion 10 - HW4 review Joe Nash jmnash@uci.edu
Homework 4 Q1 Time 1 2 3 4 5 6 7 8 9 10 11 12 RS e c b a g d F0 F1 F2 Page fault? x - 1. Optimal Total page fault: 7
Homework 4 Q1 Time 1 2 3 4 5 6 7 8 9 10 11 12 RS e c b a g d F0 F1 F2 Page fault? x - 2. LRU Total page fault: 9
Homework 4 Q1 Time 1 2 3 4 5 6 7 8 9 10 11 12 RS e c b a g d F0 F1 F2 Page fault? x - 3. LRU approximation algorithm: Second chance Total page fault: 8
Homework 4 Q2 Paging and TLB (24 points) A computer keeps its page tables in memory. The overhead required for reading a value from memory is 3 microseconds. The computer has TLB, which holds pairs (virtual page, physical page frame). What is the effective access time if the TLB has access time of 500ns and we observe a 80% TLB hit rate? Show your work. EAT = (3us + 500ns)*0.8 + (6us + 500ns)*(1-0.8) = 4.1us What is the effective access time if the TLB has access time of 800ns and we observe a 95% TLB hit rate? Show your work. EAT = (3us + 800ns)*0.95 + (6us + 800ns)*(1-0.95) = 3.95us
Homework 4 Q3 In the above diagram, what is the term for the phenomena occurring in region A? Thrashing What is one way to control the phenomena? Establish an acceptable page-fault rate Name one system other than paging which may exhibit the phenomena. Cache, TLB, heap, process scheduling (anytime you spend more time swapping than using something)
Homework 4 Q3 Consider a file currently consisting of 100 blocks. Assume that the filecontrol block (and the index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if, for one block, the following conditions hold. In the contiguous-allocation case, assume that there is no room to grow at the beginning but there is room to grow at the end. Also assume that the block information to be added is stored in memory. Textbook section 12.4 You need to read something and then write it elsewhere to move it Doing things in memory is ‘free’
Homework 4 Q3 Credit: Abraham_Silberschatz-Operating_System_Concepts__9t
Homework 4 Q3 a. The block is added at the beginning. Consider a file currently consisting of 100 blocks. Assume that the filecontrol block (and the index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if, for one block, the following conditions hold. In the contiguous-allocation case, assume that there is no room to grow at the beginning but there is room to grow at the end. Also assume that the block information to be added is stored in memory. a. The block is added at the beginning. b. The block is added in the middle. c. The block is added at the end. d. The block is removed from the beginning. e. The block is removed from the middle. f. The block is removed from the end. Answer: Contiguous Linked Indexed a. 201 1 1 b. 101 52 1 c. 1 3 1 d. 198 1 0 e. 98 52 0 f. 0 100 0
Homework 4 Q5 Limit?
Homework 4 Q5 STBR 111010 Memory address contents note 10 110 S1PD 11 1000 100 1010 101 1100 1110 S1PT1 111 10000 10010 S1PT2 1001 10100 10110 S1PT3 1011 11000 11010 S1PT4 1101 11100 10001101 S1F1 1111 1000101 11001011 S1F2 10001 101001 10010 101010 S1F3 10011 11010001 10100 11001 S1F4 10101 10111100 10110 111100 S1F5 10111 11110100 11000 11111000 S1F6 1001011 11010 11011101 S1F7 11011 10000111 11100 1000101 S1F8 11101 11110 100010 S2PD 11111 100100 100000 100110 100001 101000 101010 S2PT1 100011 101100 101110 S2PT2 100101 110000 110010 S2PT3 100111 110100 110110 S2PT4 101001 111000 10000111 S2F1 101011 10001010 10010010 S2F2 101101 10010011 101110 11001011 S2F3 101111 100000 110000 10110101 S2F4 110001 110010 10111100 S2F5 110011 10111000 110100 10101100 S2F6 110101 11011 110110 11111100 S2F7 110111 10110100 111000 S2F8 111001 1101001 111010 10 seg table 111011 11110
Homework 4 Q5 Virtual Address Value 01010101 (example) 01110001 10110101 01110001 10110100 00100100 11111000 00000101 101001 01000000 10000111 00010001 11010001
Topics to review for the final Everything from the review lecture Homework problems
Any questions? Good luck on the final