









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A set of problems from the cs 162 midterm exam ii in 2007. The problems cover various topics including virtual memory management, network file servers, and disk access. The problems involve calculating maximum packet sizes, ideal data transfer rates, tcp window sizes, and total time to read data from disk.
Typology: Exams
1 / 17
This page cannot be seen from the preview
Don't miss anything!
University of California, Berkeley College of Engineering Computer Science Division ⎯ EECS Fall 2007 John Kubiatowicz
December 3rd^ , 2007 CS162: Operating Systems and Systems Programming
Your Name:
SID Number: Circle the letters of CS Login
First: a b c d e f g h I j k l m n o p q r s t u v w x y z Second: a b c d e f g h I j k l m n o p q r s t u v w x y z
Discussion Section:
General Information: This is a closed book exam. You are allowed 1 page of hand-written notes (both sides). You have 3 hours to complete as much of the exam as possible. Make sure to read all of the questions first, as some of the questions are substantially more time consuming.
Write all of your answers directly on this paper. Make your answers as concise as possible. On programming questions, we will be looking for performance as well as correctness, so think through your answers carefully. If there is something about the questions that you believe is open to interpretation, please ask us about it!
Problem Possible Score
Total
Problem 1f[2pts]: The rate of page faults in a virtual memory system can always be reduced by adding more memory.
Problem 1g[2pts]: Compulsory misses in a cache can be reduced with prefetching.
Problem 1h[2pts]: A “memoryless” probability distribution provides a poor model for any real sources of events.
Problem 1i[2pts]: Nonvolatile Ram (NVRAM) can improve the durability of a file system that uses delayed writes.
Problem 1j[2pts]: Because of the 32-bit IP-V4 address space, it is impossible for more than 2 32 computers to communicate over the internet.
Problem 2: Virtual Memory and Paging [25pts] Consider a two-level memory management scheme on 22-bit virtual addresses using the following format for virtual addresses:
Virtual Page # (7 bits)
Virtual Page # (7 bits)
Offset (8 bits)
Virtual addresses are translated into 16-bit physical addresses of the following form:
Physical Page # (8 bits)
Offset (8 bits)
Page table entries are 16 bits in the following format, stored in big-endian form in memory (i.e. the MSB is first byte in memory).
Physical Page # (8 bits)
Kernel OnlyUncacheable
0 0
DirtyUse WriteValid
Note that a virtual-physical translation can fail at any point if an incompatible PTE is encountered. Two types of errors can occur during translation: “invalid page” (page is not mapped at all) or “access violation” (page exists, but access was illegal).
Problem 2a[2pts]: Can you give a logical reason why the designer might have made the virtual page # fields 7 bits each?
Problem 2b[2pts]: What is the maximum amount of physical memory addressable by this system? Can you think of a way to increase the amount of available physical memory without altering the widths of the virtual addresses or PTEs?
Problem 3c[2pts]: How many total bits of storage will each entry of the TLB consume (including the tag and/or other fields)? Explain.
Virtual Page # (7 bits)
Virtual Page # (7 bits)
Offset (8 bits)
Physical Page # (8 bits)
Kernel Not
Cacheable 0 0
DirtyUse WriteValid
Problem 2g[4pts]: For the following problem, assume a hypothetical machine with 4 pages of physical memory and 7 pages of virtual memory. Given the access pattern: A B C D E F C A A F F G A B G D F F Indicate in the following table which pages are mapped to which physical pages for each of the following policies. Assume that a blank box matches the element to the left. We have given the FIFO policy as an example.
Access→ A B C D E F C A A F F G A B G D F F 1 A E B 2 B F D 3 C A F
Problem 2i[3pts]: What is a precise exception and why would we want a software TLB fault to generate a precise exception?
Problem 3e[2pts]: The Fast File System (FFS) of Berkeley 4.2 Unix utilized “Skip Sector Positioning” to improve performance. Explain what “Skip Sector Positioning” is and why this optimization may no longer be important.
Problem 3f[3pts]: The Network File System (NFS) uses a “stateless” protocol between clients and servers. What does this mean? Name one advantage and one disadvantage of stateless filesystem protocols.
Problem 3j[6pts]: Suppose that a new disk technology provided access times that are of the same order of magnitude as memory access times. What, if anything, must be changed in the following three OS components to take advantage of the quicker access time? If something doesn’t change, be very specific why it doesn’t change. If it will change, contrast these changes with current implementation and be as specific as possible in your answers (i.e. identify what would change and why).
Problem 4a[3pts]: What is the maximum amount of data that the client or server can send in each packet while avoiding fragmentation along the way? Remember that the TCP+IP header is 40 bytes. Explain.
Problem 4b[2pts]: Explain how the client or server could automatically discover the answer to 4a:
Problem 4c[2pts]: Under ideal circumstances (and ignoring interrupt and copying overheads and window sizes), what is the maximum data bandwidth that could be sent from the server to the client without dropping packets, assuming that the server utilizes the mechanism in 4b? Explain.
Problem 4d[3pts]: Assume that a maximal sized packet (as in 4a) is sent from the TCP send buffer of the server to the TCP receive buffer of the client. Compute the total roundtrip latency from the point at which the server invokes the device driver to send the packet until it receive the ACK via an interrupt. Hint: don’t forget the interrupt at the receiving side and the DMA mechanism into and out of the network.
Problem 4e[3pts]: What TCP window size is necessary to achieve the bandwidth of 4c without dropping packets in the network? Use simple constants and values that you computed for 4a-4d. Explain. Make sure that you correct for units.
Problem 4f[6pts]: Suppose that video files are laid out in 64K (65536 bytes) chunks on the disk (i.e. 64K in successive sectors on a track). Compute the overhead for reading such a 64K chunk from a random place on the disk. Assume that the disk controller automatically DMAs the data to kernel memory in a fashion that is overlapped with reading it from the disk (so that you do not have to worry about DMA for this operation). After finishing, the controller generates an interrupt; the interrupt routine may submit another request to the controller (if one is queued on the DDRQ). Assume the disk parameters given above (repeated here):
What is the total time to read 64K chunk from a random place on the disk into memory including the interrupt? Hint: there are 5 terms here including the interrupt!
Problem 4j[5pts]: Returning to our single-disk server, assume that 15 clients connect through network resources that are independent up to router #2. Each client has its own user-level process working on its behalf. Assume that all 15 clients send requests at a rate of (4g). If the disk response distribution can be described with C=1.5 and the aggregate network request rate can be described as exponential, what is the average length of the disk device driver request queue (DDRQ)? Hint: the service time for the disk is the time between requests to the disk controller when the DDRQ is full. Possibly useful formulas include:
Mean Service: = (^) ∑ (^) =
n server (^) n i 1 Ti
T Variance: = (^) ∑ (^) = ( − )
n n i^^1 Ti^ Tserver
M/G/1 queue: (^) ⎟ ⎠
u
C u 2 1
Tq Tserver Little’s law: Lq =λ × Tq