



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




NOTE: Please write your ID on every page of the exam.
Total
Answer the following questions about the optimizations suggested by the Fast File System (FFS) paper.
a) The FFS authors claim doubling block size roughly doubled throughput. Of course, this trend wouldnt continue forever. Give two reasons why youd expect continuing to double the block size to eventually experience declining returns.
b) Cylinder groups were one of the key contributions of the Fast File System. They do not specify how big they should be, however. Describe the tradeo?s between large and small groups, and suggest a method to select an appropriate size for a given disk and/or ?le system?
c) The authors also optimized the FFS to take advantage of the rotational latency of a given disk. Suppose an already-formatted FFS disk suddenly started spinning twice as fast. What would happen to FFS performance, and why?
d) One thing FFS was unable to do, however, was avoid synchronous meta-data updates. Why is in that LFS can postpone meta- data writes until a segment is ?ushed to disk (asynchronous writes), yet FFS is forced to write meta-data updates synchronously?
Consider the following kernel implementation of semaphore operations:
wait (sem s) { if s equals 0, block the running process and associate with s; decrement s; return; }
signal (sem s) { increment s; if any blocked processes associated with s, unblock one of them; return; }
Assume that the kernel executes with interrupts disabled.
(a) Is there any problem with this implementation for execution on a uniprocessor? Explain (and state all your assumptions).
(b) Is there any problem with this implementation for execution on a multiprocessor? Explain (and state all your assumptions).
Consider the following atomic instruction FetchAndAdd implemented as follows:
function FetchAndAdd(address location) { int value := *location *location := value + 1 return value }
Give pseudocode for acquring and releasing a spin lock based on FetchAndAdd. You should give code for locking and for unlocking the spin lock. Hint: Unlike the solution used with the TestAndSet atomic instruction, use two integers rather than one to represent the lock, and don’t have lock or unlock spin continuiously executing FetchAndAdd.