Download presentation
Presentation is loading. Please wait.
Published byMaría Jesús Herrera Lucero Modified over 6 years ago
1
ICS 143 - Principles of Operating Systems
Discussion 10 - HW4 review Joe Nash
2
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
3
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
4
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
5
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)* (6us + 800ns)*(1-0.95) = 3.95us
6
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)
7
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’
8
Homework 4 Q3 Credit: Abraham_Silberschatz-Operating_System_Concepts__9t
9
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 b c d e f
10
Homework 4 Q5 Limit?
11
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 S1F1 1111 S1F2 10001 101001 10010 101010 S1F3 10011 10100 11001 S1F4 10101 10110 111100 S1F5 10111 11000 S1F6 11010 S1F7 11011 11100 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 S2F1 101011 S2F2 101101 101110 S2F3 101111 100000 110000 S2F4 110001 110010 S2F5 110011 110100 S2F6 110101 11011 110110 S2F7 110111 111000 S2F8 111001 111010 10 seg table 111011 11110
12
Homework 4 Q5 Virtual Address Value 01010101 (example) 01110001
101001
13
Topics to review for the final
Everything from the review lecture Homework problems
14
Any questions? Good luck on the final
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.