ECEC-353 Chap 9 - 9.1 A page fault occurs when an access to...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
9.1 A page fault occurs when an access to a page that has not been brought into main memory takes place. The operating system veriFes the memory access, aborting the program if it is invalid. If it is valid, a free frame is located and I/O is requested to read the needed page into the free frame. Upon completion of I/O, the process table and page table are updated and the instruction is restarted. 9.2 A. n B. p 9.3 a. Stack—good. b. Hashed symbol table —not good. c. Sequential search—good. d. Binary search—not good. e. Pure code —good. f. Vector operations—good. g. Indirection—not good. 9.4 Ran k Algorithm Suffer from Belady’s anomalu 1 Optimal No 2 LRU No 3 Second-chance Yes 4 ±I±O Yes 9.5 The costs are additional hardware and slower access time. The beneFts are good utilization of memory and larger logical address space than physical address space. 9.6 Effective access time = 0.99 × (1 usec + 0.008 × (2 usec) + 0.002 × (10,000 usec + 1,000 usec) + 0.001 × (10,000 usec + 1,000 usec) = (0.99 + 0.016 + 22.0 + 11.0) usec = 34.0 usec 9.7 a.5000 b. 50 9.8 Number of ±rames LRU ±I±O Optimal 1 20 20 20 2 18 18 15 3 15 16 11 4 10 14 8 5 8 10 7 6 7 10 7 7 7 7 7
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
9.9 You can use the valid/invalid bit supported in hardware to simulate the reference bit. Initially set the bit to invalid. On Frst reference a trap to the operating system is generated. The operating system will set a software bit to 1 and reset the valid/invalid bit to valid. 9.10 No. An optimal algorithm will not suffer from Belady’s anomaly because —by deFnition—an optimal algorithm replaces the page that will not be used for the longest time. Belady’s anomaly occurs when a page- replacement algorithm evicts a page that will be needed in the immediate future. An optimal algorithm would not have selected such a page. 9.11 a. ±I±O. ±ind the Frst segment large enough to accommodate the incoming segment. If relocation is not possible and no one segment is large enough, select a combination of segments whose memories are contiguous, which are “closest to the Frst of the list” and which can accommodate the new segment. If relocation is possible, rearrange the memory so that the Frst N segments large enough for the incoming segment are contiguous in memory. Add any leftover space to the free-space list in both cases. b. LRU. Select the segment that has not been used for the longest period of time and that is large enough, adding any leftover space to the free space list. If no one segment is large enough, select a combination of the “oldest” segments that are contiguous in memory (if relocation is not available) and that are large enough. If relocation is available, rearrange the oldest N segments to be contiguous in memory and replace those with the new segment.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/02/2011 for the course ECONOMY 111 taught by Professor Sm during the Spring '11 term at Hanoi University of Technology.

Page1 / 6

ECEC-353 Chap 9 - 9.1 A page fault occurs when an access to...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online